{"record":{"id":"01d523e887141dce","repo":"elastic/elasticsearch","slug":"architecture-not-specified-for-jdk-name","errorCode":null,"errorMessage":"architecture not specified for jdk [${name}]","messagePattern":"architecture 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":203,"sourceCode":"\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    }\n\n    private void parseVersion(String version) {\n        // decompose the bundled jdk version, broken into elements as: [feature, interim, update, build]\n        // Note the \"patch\" version is not yet handled here, as it has not yet been used by java.\n        Matcher jdkVersionMatcher = VERSION_PATTERN.matcher(version);\n        if (jdkVersionMatcher.matches() == false) {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java#L185-L221","documentation":"Thrown by Jdk.finalizeValues() when the architecture Property is unset (architecture.isPresent() == false). It is the fourth and final presence guard in finalizeValues(). Without an architecture the dependency classifier cannot be formed.","triggerScenarios":"A Jdk is declared with version, platform, and vendor but setArchitecture(...) is never called, then the configuration is resolved.","commonSituations":"Forgetting the architecture line; assuming 'x64' is implicit (it is not).","solutions":["Add architecture = '<aarch64|x64>' to the named jdk block.","Remove the partially-configured jdk declaration if it is unused."],"exampleFix":"// before\njdks { j { version='21.0.3+9'; platform='linux'; vendor='adoptium'; } }\n// after\njdks { j { version='21.0.3+9'; platform='linux'; vendor='adoptium'; architecture='x64'; } }","handlingStrategy":"validation","validationCode":"// Ensure the architecture property is set before resolution:\njdks {\n  my_jdk {\n    version = '21.0.3+9'\n    platform = 'linux'\n    vendor = 'adoptium'\n    architecture = 'x64'   // <-- required, no default\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["architecture has no default — always set it explicitly.","Set all four properties in one block.","Detect the host arch once and reuse it for every jdk block to avoid forgetting it."],"tags":["gradle","jdk","build-config","validation","missing-property"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:31:55.035Z"}