elastic/elasticsearch · error · IllegalArgumentException
architecture not specified for jdk [${name}]
Error message
architecture not specified for jdk [${name}] What it means
Thrown by Jdk.finalizeValues() when the architecture Property is unset (architecture.isPresent() == false). It is the fourth and final presence guard in finalizeValues(). Without an architecture the dependency classifier cannot be formed.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/Jdk.java:203
private String getHomeRoot() {
boolean isOSX = "mac".equals(getPlatform()) || "darwin".equals(getPlatform());
return getPath() + (isOSX ? "/Contents/Home" : "");
}
// internal, make this jdks configuration unmodifiable
void finalizeValues() {
if (version.isPresent() == false) {
throw new IllegalArgumentException("version not specified for jdk [" + name + "]");
}
if (platform.isPresent() == false) {
throw new IllegalArgumentException("platform not specified for jdk [" + name + "]");
}
if (vendor.isPresent() == false) {
throw new IllegalArgumentException("vendor not specified for jdk [" + name + "]");
}
if (architecture.isPresent() == false) {
throw new IllegalArgumentException("architecture not specified for jdk [" + name + "]");
}
version.finalizeValue();
platform.finalizeValue();
vendor.finalizeValue();
architecture.finalizeValue();
distributionVersion.finalizeValue();
}
@Override
public Iterator<File> iterator() {
return configuration.iterator();
}
private void parseVersion(String version) {
// decompose the bundled jdk version, broken into elements as: [feature, interim, update, build]
// Note the "patch" version is not yet handled here, as it has not yet been used by java.
Matcher jdkVersionMatcher = VERSION_PATTERN.matcher(version);
if (jdkVersionMatcher.matches() == false) {View on GitHub (pinned to db6a809a66)
Solutions
- Add architecture = '<aarch64|x64>' to the named jdk block.
- Remove the partially-configured jdk declaration if it is unused.
Example fix
// before
jdks { j { version='21.0.3+9'; platform='linux'; vendor='adoptium'; } }
// after
jdks { j { version='21.0.3+9'; platform='linux'; vendor='adoptium'; architecture='x64'; } } Defensive patterns
Strategy: validation
Validate before calling
// Ensure the architecture property is set before resolution:
jdks {
my_jdk {
version = '21.0.3+9'
platform = 'linux'
vendor = 'adoptium'
architecture = 'x64' // <-- required, no default
}
} Prevention
- architecture has no default — always set it explicitly.
- Set all four properties in one block.
- Detect the host arch once and reuse it for every jdk block to avoid forgetting it.
When it happens
Trigger: A Jdk is declared with version, platform, and vendor but setArchitecture(...) is never called, then the configuration is resolved.
Common situations: Forgetting the architecture line; assuming 'x64' is implicit (it is not).
Related errors
- version not specified for jdk [${name}]
- platform not specified for jdk [${name}]
- vendor not specified for jdk [${name}]
- unknown vendor [${vendor}] for jdk [${name}], must be one of
- malformed version [${version}] for jdk [${name}]
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/01d523e887141dce.
Report an issue: GitHub.