elastic/elasticsearch · error · IllegalArgumentException

unknown vendor [${vendor}] for jdk [${name}], must be one of

Error message

unknown vendor [${vendor}] for jdk [${name}], must be one of ${ALLOWED_VENDORS}

What it means

Thrown by Jdk.setVendor when the supplied vendor string is not in the ALLOWED_VENDORS allowlist (adoptium, openjdk, zulu). The Jdk object models a downloadable JDK bundle for the build; the vendor drives which Ivy repository URL and artifact pattern JdkDownloadPlugin selects, so an unrecognized vendor cannot be resolved to a download source.

Source

Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java:72

        this.configuration = configuration;
        this.vendor = objectFactory.property(String.class);
        this.version = objectFactory.property(String.class);
        this.platform = objectFactory.property(String.class);
        this.architecture = objectFactory.property(String.class);
        this.distributionVersion = objectFactory.property(String.class);
    }

    public String getName() {
        return name;
    }

    public String getVendor() {
        return vendor.get();
    }

    public void setVendor(final String vendor) {
        if (ALLOWED_VENDORS.contains(vendor) == false) {
            throw new IllegalArgumentException("unknown vendor [" + vendor + "] for jdk [" + name + "], must be one of " + ALLOWED_VENDORS);
        }
        this.vendor.set(vendor);
    }

    public String getVersion() {
        return version.get();
    }

    public void setVersion(String version) {
        if (VERSION_PATTERN.matcher(version).matches() == false
            && LEGACY_VERSION_PATTERN.matcher(version).matches() == false
            && EA_VERSION_PATTERN.matcher(version).matches() == false) {
            throw new IllegalArgumentException("malformed version [" + version + "] for jdk [" + name + "]");
        }
        parseVersion(version);
        this.version.set(version);
    }

View on GitHub (pinned to db6a809a66)

Solutions

  1. Set the vendor to one of the allowed values: 'adoptium', 'openjdk', or 'zulu' (for JDK 8 on macOS Apple Silicon only).
  2. Prefer 'adoptium' for current JDK distributions; use 'openjdk' for Oracle/OpenJDK builds; use 'zulu' only for the JDK 8 aarch64 macOS case.
  3. Check for trailing whitespace or wrong case in the vendor assignment.

Example fix

// before
jdks { bundler { vendor = 'temurim'; } }
// after
jdks { bundler { vendor = 'adoptium'; } }
Defensive patterns

Strategy: validation

Validate before calling

import java.util.List;
final List<String> ALLOWED_VENDORS = List.of("adoptium", "openjdk", "zulu");
void setJdkVendor(String vendor) {
    if (!ALLOWED_VENDORS.contains(vendor)) {
        throw new IllegalArgumentException(
            "vendor must be one of " + ALLOWED_VENDORS + ", got: " + vendor);
    }
    // ... proceed
}

Prevention

When it happens

Trigger: Calling Jdk.setVendor(vendor) (or configuring jdks { myjdk { vendor = '...' } } in a Gradle script) with a value not equal to 'adoptium', 'openjdk', or 'zulu'. The check is ALLOWED_VENDORS.contains(vendor) == false.

Common situations: Typing a vendor name (e.g. 'oracle', 'temurin', 'azul', 'redhat', 'microsoft'); using a legacy vendor identifier from an older Elasticsearch version; copy-pasting a vendor from documentation for a different build system; trailing whitespace or case mismatch (the comparison is case-sensitive).

Related errors


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