{"record":{"id":"b438d695b414f391","repo":"elastic/elasticsearch","slug":"jdk-vendor-zulu-is-supported-only-for-jdk8-on-maco","errorCode":null,"errorMessage":"JDK vendor zulu is supported only for JDK8 on MacOS with Apple Silicon.","messagePattern":"JDK vendor zulu is supported only for JDK8 on MacOS with Apple Silicon\\.","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java","lineNumber":161,"sourceCode":"                } else {\n                    // simpler legacy pattern from JDK 9 to JDK 12 that we are advocating to Oracle to bring back\n                    artifactPattern = \"java/GA/jdk\"\n                        + jdk.getMajor()\n                        + \"/\"\n                        + jdk.getBuild()\n                        + \"/GPL/openjdk-[revision]_[module]-[classifier]_bin.[ext]\";\n                }\n            }\n        } else if (jdk.getVendor().equals(VENDOR_ZULU)) {\n            repoUrl = \"https://cdn.azul.com\";\n            if (jdk.getMajor().equals(\"8\") && isJdkOnMacOsPlatform(jdk) && jdk.getArchitecture().equals(\"aarch64\")) {\n                artifactPattern = \"zulu/bin/zulu\"\n                    + jdk.getDistributionVersion()\n                    + \"-ca-jdk\"\n                    + jdk.getBaseVersion().replace(\"u\", \".0.\")\n                    + \"-[module]x_[classifier].[ext]\";\n            } else {\n                throw new GradleException(\"JDK vendor zulu is supported only for JDK8 on MacOS with Apple Silicon.\");\n            }\n        } else {\n            throw new GradleException(\"Unknown JDK vendor [\" + jdk.getVendor() + \"]\");\n        }\n\n        // Define the repository if we haven't already\n        if (repositories.findByName(repoName) == null) {\n            repositories.ivy(repo -> {\n                repo.setName(repoName);\n                repo.setUrl(repoUrl);\n                repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);\n                repo.patternLayout(layout -> layout.artifact(artifactPattern));\n                repo.content(repositoryContentDescriptor -> repositoryContentDescriptor.includeGroup(groupName(jdk)));\n            });\n        }\n    }\n\n    @SuppressWarnings(\"unchecked\")","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java#L143-L179","documentation":"Thrown by JdkDownloadPlugin.setupRepository when vendor == 'zulu' but the combination of major version, platform, and architecture is not the single supported case: JDK 8 (major '8') on macOS (platform 'mac' or 'darwin') with architecture 'aarch64' (Apple Silicon). The zulu repository path template is only constructed for that one combination; any other zulu configuration has no valid download URL.","triggerScenarios":"jdk.getVendor().equals(VENDOR_ZULU) is true, and NOT (jdk.getMajor().equals('8') && isJdkOnMacOsPlatform(jdk) && jdk.getArchitecture().equals('aarch64')). E.g. zulu + x64, zulu + linux, zulu + JDK 17.","commonSituations":"Selecting 'zulu' for a non-Mac or non-ARM build; trying to use zulu for a modern JDK; copy-pasting a zulu config from an Apple-Silicon macOS host onto a Linux/x64 build agent.","solutions":["For any platform/architecture other than macOS Apple Silicon, switch vendor to 'adoptium' (or 'openjdk'), which covers Linux, Windows, x64, and aarch64.","If you genuinely need JDK 8 on macOS Apple Silicon, ensure all three are set: vendor='zulu', version in legacy 8uXXX+bNN form (so major parses as '8'), platform='darwin' (or 'mac'), architecture='aarch64'.","Do not set vendor='zulu' for JDK 9+ — zulu support is intentionally restricted."],"exampleFix":"// before (Linux x64, invalid for zulu)\njdks { j { vendor='zulu'; platform='linux'; architecture='x64'; version='8u402+b06'; } }\n// after\njdks { j { vendor='adoptium'; platform='linux'; architecture='x64'; version='8u402+b06'; } }","handlingStrategy":"validation","validationCode":"boolean zuluSupported(Jdk jdk) {\n    return jdk.getVendor().equals(\"zulu\")\n        && jdk.getMajor().equals(\"8\")\n        && (jdk.getPlatform().equals(\"mac\") || jdk.getPlatform().equals(\"darwin\"))\n        && jdk.getArchitecture().equals(\"aarch64\");\n}\n// If !zuluSupported(jdk) and vendor is zulu, switch to adoptium/openjdk before resolve.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve vendor='zulu' for the single supported case: JDK 8 + macOS + Apple Silicon.","Default to 'adoptium' for Linux/Windows/x64/modern JDKs.","Parameterize jdk blocks by OS/arch so the same script works across agents."],"tags":["gradle","jdk","vendor","zulu","macos","aarch64","build-config"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}