{"record":{"id":"b795137f020e1baa","repo":"elastic/elasticsearch","slug":"unknown-architecture-architecture-for-jdk","errorCode":null,"errorMessage":"unknown architecture [${architecture}] for jdk [${name}], must be one of ${ALLOWED_ARCHITECTURES}","messagePattern":"unknown architecture \\[(.+?)\\] for jdk \\[(.+?)\\], must be one of (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java","lineNumber":110,"sourceCode":"        return platform.get();\n    }\n\n    public void setPlatform(String platform) {\n        if (ALLOWED_PLATFORMS.contains(platform) == false) {\n            throw new IllegalArgumentException(\n                \"unknown platform [\" + platform + \"] for jdk [\" + name + \"], must be one of \" + ALLOWED_PLATFORMS\n            );\n        }\n        this.platform.set(platform);\n    }\n\n    public String getArchitecture() {\n        return architecture.get();\n    }\n\n    public void setArchitecture(final String architecture) {\n        if (ALLOWED_ARCHITECTURES.contains(architecture) == false) {\n            throw new IllegalArgumentException(\n                \"unknown architecture [\" + architecture + \"] for jdk [\" + name + \"], must be one of \" + ALLOWED_ARCHITECTURES\n            );\n        }\n        this.architecture.set(architecture);\n    }\n\n    public String getDistributionVersion() {\n        return distributionVersion.getOrNull();\n    }\n\n    public void setDistributionVersion(String distributionVersion) {\n        this.distributionVersion.set(distributionVersion);\n    }\n\n    public String getBaseVersion() {\n        return baseVersion;\n    }\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java#L92-L128","documentation":"Thrown by Jdk.setArchitecture when the architecture string is not in ALLOWED_ARCHITECTURES (aarch64, x64). The architecture becomes the classifier in the dependency coordinate and is checked again for the zulu/JDK8/aarch64-only path, so an unrecognized value cannot be downloaded.","triggerScenarios":"Jdk.setArchitecture(architecture) is called with a value other than 'aarch64' or 'x64'.","commonSituations":"Using 'amd64' or 'x86_64' instead of 'x64'; 'arm64' instead of 'aarch64'; 'i386' or 'x86' (not supported at all); 'aarch64-linux' (mixing platform into architecture); case mismatch.","solutions":["Use 'x64' for Intel/AMD 64-bit; use 'aarch64' for ARM 64-bit (including Apple Silicon).","Do not use 'amd64', 'x86_64', or 'arm64' — they are not in the allowlist.","Verify case — values are lowercase and case-sensitive."],"exampleFix":"// before\njdks { j { architecture = 'amd64'; } }\n// after\njdks { j { architecture = 'x64'; } }","handlingStrategy":"validation","validationCode":"import java.util.List;\nfinal List<String> ALLOWED_ARCHITECTURES = List.of(\"aarch64\", \"x64\");\nvoid setJdkArchitecture(String architecture) {\n    if (!ALLOWED_ARCHITECTURES.contains(architecture)) {\n        throw new IllegalArgumentException(\n            \"architecture must be one of \" + ALLOWED_ARCHITECTURES + \", got: \" + architecture);\n    }\n    // ... proceed\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Map common aliases before assignment: 'amd64'/'x86_64' -> 'x64'; 'arm64' -> 'aarch64'.","Keep architecture and platform in separate fields; never combine them.","Centralize JDK config so all four properties are always set together."],"tags":["gradle","jdk","build-config","validation","architecture"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}