{"record":{"id":"e2caa9fc57aa02a8","repo":"elastic/elasticsearch","slug":"unknown-platform-platform-for-jdk-name","errorCode":null,"errorMessage":"unknown platform [${platform}] for jdk [${name}], must be one of ${ALLOWED_PLATFORMS}","messagePattern":"unknown platform \\[(.+?)\\] 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":97,"sourceCode":"    }\n\n    public void setVersion(String version) {\n        if (VERSION_PATTERN.matcher(version).matches() == false\n            && LEGACY_VERSION_PATTERN.matcher(version).matches() == false\n            && EA_VERSION_PATTERN.matcher(version).matches() == false) {\n            throw new IllegalArgumentException(\"malformed version [\" + version + \"] for jdk [\" + name + \"]\");\n        }\n        parseVersion(version);\n        this.version.set(version);\n    }\n\n    public String getPlatform() {\n        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    }","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java#L79-L115","documentation":"Thrown by Jdk.setPlatform when the platform string is not in ALLOWED_PLATFORMS (darwin, linux, windows, mac). The platform selects the OS-specific artifact classifier, the archive extension (zip for windows, tar.gz otherwise), and the macOS '/Contents/Home' layout, so an unknown platform cannot be mapped to a downloadable bundle.","triggerScenarios":"Jdk.setPlatform(platform) is called with a value other than 'darwin', 'linux', 'windows', or 'mac'. Note 'mac' and 'darwin' are both accepted macOS aliases.","commonSituations":"Using 'osx' (the common-but-unaccepted macOS identifier); 'macos' (unaccepted — JdkDownloadPlugin maps mac/darwin to 'macos' only in dependency notation, not as a platform value); 'win' or 'win32'; 'x86_64-linux' (that is an architecture+os combo); case mismatch.","solutions":["Set platform to one of: 'darwin', 'mac' (both = macOS), 'linux', or 'windows'.","For macOS use 'darwin' or 'mac'; do not use 'osx' or 'macos'.","Verify case — values are lowercase and case-sensitive."],"exampleFix":"// before\njdks { j { platform = 'osx'; } }\n// after\njdks { j { platform = 'darwin'; } }","handlingStrategy":"validation","validationCode":"import java.util.List;\nfinal List<String> ALLOWED_PLATFORMS = List.of(\"darwin\", \"linux\", \"windows\", \"mac\");\nvoid setJdkPlatform(String platform) {\n    if (!ALLOWED_PLATFORMS.contains(platform)) {\n        throw new IllegalArgumentException(\n            \"platform must be one of \" + ALLOWED_PLATFORMS + \", got: \" + platform);\n    }\n    // ... proceed\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 'darwin' or 'mac' for macOS (never 'osx' or 'macos').","Use 'linux' or 'windows' verbatim; values are lowercase and case-sensitive.","Do not combine architecture into the platform string (e.g. avoid 'linux-x64')."],"tags":["gradle","jdk","build-config","validation","platform"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}