elastic/elasticsearch · error · GradleException

JDK vendor zulu is supported only for JDK8 on MacOS with App

Error message

JDK vendor zulu is supported only for JDK8 on MacOS with Apple Silicon.

What it means

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.

Source

Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/JdkDownloadPlugin.java:161

                } else {
                    // simpler legacy pattern from JDK 9 to JDK 12 that we are advocating to Oracle to bring back
                    artifactPattern = "java/GA/jdk"
                        + jdk.getMajor()
                        + "/"
                        + jdk.getBuild()
                        + "/GPL/openjdk-[revision]_[module]-[classifier]_bin.[ext]";
                }
            }
        } else if (jdk.getVendor().equals(VENDOR_ZULU)) {
            repoUrl = "https://cdn.azul.com";
            if (jdk.getMajor().equals("8") && isJdkOnMacOsPlatform(jdk) && jdk.getArchitecture().equals("aarch64")) {
                artifactPattern = "zulu/bin/zulu"
                    + jdk.getDistributionVersion()
                    + "-ca-jdk"
                    + jdk.getBaseVersion().replace("u", ".0.")
                    + "-[module]x_[classifier].[ext]";
            } else {
                throw new GradleException("JDK vendor zulu is supported only for JDK8 on MacOS with Apple Silicon.");
            }
        } else {
            throw new GradleException("Unknown JDK vendor [" + jdk.getVendor() + "]");
        }

        // Define the repository if we haven't already
        if (repositories.findByName(repoName) == null) {
            repositories.ivy(repo -> {
                repo.setName(repoName);
                repo.setUrl(repoUrl);
                repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
                repo.patternLayout(layout -> layout.artifact(artifactPattern));
                repo.content(repositoryContentDescriptor -> repositoryContentDescriptor.includeGroup(groupName(jdk)));
            });
        }
    }

    @SuppressWarnings("unchecked")

View on GitHub (pinned to db6a809a66)

Solutions

  1. For any platform/architecture other than macOS Apple Silicon, switch vendor to 'adoptium' (or 'openjdk'), which covers Linux, Windows, x64, and aarch64.
  2. 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'.
  3. Do not set vendor='zulu' for JDK 9+ — zulu support is intentionally restricted.

Example fix

// before (Linux x64, invalid for zulu)
jdks { j { vendor='zulu'; platform='linux'; architecture='x64'; version='8u402+b06'; } }
// after
jdks { j { vendor='adoptium'; platform='linux'; architecture='x64'; version='8u402+b06'; } }
Defensive patterns

Strategy: validation

Validate before calling

boolean zuluSupported(Jdk jdk) {
    return jdk.getVendor().equals("zulu")
        && jdk.getMajor().equals("8")
        && (jdk.getPlatform().equals("mac") || jdk.getPlatform().equals("darwin"))
        && jdk.getArchitecture().equals("aarch64");
}
// If !zuluSupported(jdk) and vendor is zulu, switch to adoptium/openjdk before resolve.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/b438d695b414f391. Report an issue: GitHub.