oracle/graal · error · JVMCIError
Unexpected OS name: %s
Error message
Unexpected OS name: %s
What it means
JVMCIError thrown by Platform while normalizing the os.name system property into an internal OS identifier. It recognizes Linux, SunOS, Mac OS X (mapped to solaris/darwin) and any name starting with 'Windows'; anything else means Graal does not know how to classify the host operating system and refuses to continue.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/Platform.java:78
*/
private static String getCurrentOSName() {
String value = getSavedProperty("os.name");
switch (value) {
case "Linux":
value = "linux";
break;
case "SunOS":
value = "solaris";
break;
case "Mac OS X":
value = "darwin";
break;
default:
// Windows names contain the OS version.
if (value.startsWith("Windows")) {
value = "windows";
} else {
throw new JVMCIError("Unexpected OS name: " + value);
}
}
return value;
}
/**
* Returns the name of the host architecture.
*/
private static String getCurrentArchName() {
String arch = getSavedProperty("os.arch");
if (arch.equals("x86_64")) {
arch = "amd64";
}
return arch;
}
}
View on GitHub (pinned to a66e9ccd1d)
Solutions
- Run on a supported OS (Linux, macOS, Windows).
- Remove any -Dos.name=... override that corrupts the real value.
- If porting, extend the switch in Platform.java to map your os.name to an internal identifier.
Example fix
# before java -Dos.name=MyOS -XX:+UseJVMCICompiler ... # after java -XX:+UseJVMCICompiler ...
Defensive patterns
Strategy: validation
Validate before calling
String os = System.getProperty("os.name", "");
boolean supported = os.equals("Linux") || os.equals("SunOS") || os.equals("Mac OS X") || os.startsWith("Windows");
if (!supported) {
throw new IllegalStateException("Unsupported os.name for Graal: " + os);
} Prevention
- Never override -Dos.name in JVMs that will run JVMCI/Graal code.
- Gate Graal-enabled runs on the supported-OS check above.
When it happens
Trigger: Executing Graal on a JVM whose os.name property reports something other than Linux/SunOS/Mac OS X/Windows*, e.g. an exotic or sandboxed JVM, a JVM with os.name overridden via -Dos.name=..., or an unsupported OS port.
Common situations: Tests that force -Dos.name for simulation and then accidentally trigger Graal compilation; running on a niche Unix (AIX, FreeBSD) where os.name is not in the switch; JVMCI code paths reaching Platform on an unported platform.
Related errors
- Set the JVMCI_VERSION_CHECK environment variable to "ignore"
- Could not execute {jdk.java}
- LogFile substitution %s cannot be combined with any other ch
- Unknown argument: %s
- too many counters, reduce number of counters or increase -XX
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/e0a96f8e819f9428.
Report an issue: GitHub.