{"record":{"id":"4d7ce003550f3776","repo":"elastic/elasticsearch","slug":"platform-not-specified-for-jdk-name","errorCode":null,"errorMessage":"platform not specified for jdk [${name}]","messagePattern":"platform not specified for jdk \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java","lineNumber":197,"sourceCode":"            @Override\n            public String toString() {\n                return getHomeRoot();\n            }\n        };\n    }\n\n    private String getHomeRoot() {\n        boolean isOSX = \"mac\".equals(getPlatform()) || \"darwin\".equals(getPlatform());\n        return getPath() + (isOSX ? \"/Contents/Home\" : \"\");\n    }\n\n    // internal, make this jdks configuration unmodifiable\n    void finalizeValues() {\n        if (version.isPresent() == false) {\n            throw new IllegalArgumentException(\"version not specified for jdk [\" + name + \"]\");\n        }\n        if (platform.isPresent() == false) {\n            throw new IllegalArgumentException(\"platform not specified for jdk [\" + name + \"]\");\n        }\n        if (vendor.isPresent() == false) {\n            throw new IllegalArgumentException(\"vendor not specified for jdk [\" + name + \"]\");\n        }\n        if (architecture.isPresent() == false) {\n            throw new IllegalArgumentException(\"architecture not specified for jdk [\" + name + \"]\");\n        }\n        version.finalizeValue();\n        platform.finalizeValue();\n        vendor.finalizeValue();\n        architecture.finalizeValue();\n        distributionVersion.finalizeValue();\n    }\n\n    @Override\n    public Iterator<File> iterator() {\n        return configuration.iterator();\n    }","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java#L179-L215","documentation":"Thrown by Jdk.finalizeValues() when the platform Property is unset (platform.isPresent() == false). It is the second guard in finalizeValues(), reached only after the version check passes. Without a platform, the OS classifier, archive extension, and home-layout cannot be determined.","triggerScenarios":"A Jdk is declared with version (and possibly vendor/architecture) but setPlatform(...) is never called, then the configuration is resolved.","commonSituations":"Declaring a jdk block and forgetting the platform line; relying on a default that does not exist (platform has no default).","solutions":["Add platform = '<darwin|mac|linux|windows>' to the named jdk block.","Remove the partially-configured jdk declaration if it is unused."],"exampleFix":"// before\njdks { j { version='21.0.3+9'; vendor='adoptium'; architecture='x64'; } }\n// after\njdks { j { version='21.0.3+9'; vendor='adoptium'; architecture='x64'; platform='linux'; } }","handlingStrategy":"validation","validationCode":"// Ensure the platform property is set before resolution:\njdks {\n  my_jdk {\n    vendor = 'adoptium'\n    version = '21.0.3+9'\n    architecture = 'x64'\n    platform = 'linux'   // <-- required, no default\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["platform has no default — always set it explicitly.","Set all four properties (version/platform/vendor/architecture) in one block.","Remove partially-configured jdk entries you no longer use."],"tags":["gradle","jdk","build-config","validation","missing-property"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}