{"record":{"id":"cee4a794b4f2cbcc","repo":"oracle/graal","slug":"set-the-jvmci-version-check-environment-variable-t","errorCode":null,"errorMessage":"Set the JVMCI_VERSION_CHECK environment variable to \"ignore\" to suppress this error or to \"warn\" to emit a warning and continue execution.","messagePattern":"Set the JVMCI_VERSION_CHECK environment variable to \"ignore\" to suppress this error or to \"warn\" to emit a warning and continue execution\\.","errorType":"exception","errorClass":"InternalError","httpStatus":null,"severity":"critical","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java","lineNumber":383,"sourceCode":"        formatter.format(\"Currently used VM configuration is: %s%n\", vmName);\n        if (vmVersion.contains(\"-jvmci-\")) {\n            formatter.format(\"Download the latest Labs OpenJDK from \" + OPEN_LABSJDK_RELEASE_URL_PATTERN);\n        } else {\n            formatter.format(\"Download JDK %s or later.\", JAVA_MIN_RELEASE);\n        }\n    }\n\n    private static void failVersionCheck(boolean exit, String errorMessage) {\n        String value = System.getenv(\"JVMCI_VERSION_CHECK\");\n        if (\"warn\".equals(value)) {\n            System.err.println(errorMessage);\n        } else if (\"ignore\".equals(value)) {\n            return;\n        } else if (exit) {\n            System.err.println(errorMessage);\n            System.exit(-1);\n        } else {\n            throw new InternalError(errorMessage);\n        }\n    }\n\n    /**\n     * Checks the JVMCI version, returning an error message if an issue is found, or {@code null} if\n     * no error is detected.\n     *\n     * @param props system properties with the following required properties:\n     *            <ul>\n     *            <li>{@code java.specification.version}: Java specification version, e.g.,\n     *            {@code \"21\"}</li>\n     *            <li>{@code java.vm.version}: Full Java VM version string, e.g.,\n     *            {@code \"21+35\"}</li>\n     *            <li>{@code java.vm.vendor}: The vendor of the Java VM, e.g.,\n     *            {@code \"GraalVM Community\"}</li>\n     *            </ul>\n     * @return an error message if the version check fails, or {@code null} if no error is detected\n     */","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java#L365-L401","documentation":"This message is the remediation hint appended by JVMCIVersionCheck.failVersionCheck when the JVMCI version embedded in the Graal compiler jar does not match the JVMCI interface of the hosting HotSpot VM. Depending on the JVMCI_VERSION_CHECK environment variable the check either prints and exits (System.exit(-1)) in the standalone tool, or throws InternalError when invoked in-process. It exists because Graal's compiler talks to JVMCI interfaces that change between JDK builds.","triggerScenarios":"Running a GraalVM compiler jar built against a different JVMCI version than the hosting JDK's libjvmci (mismatched java.vm.version vs the versions listed in JVMCI_MIN_VERSIONS), e.g. dropping a newer compiler jar into an older JDK's jdk.internal.vm.ci, or running mx graal-export... against an incompatible JDK.","commonSituations":"Mixing a compiler build from master with a released JDK; upgrading the JDK but keeping an old compiler jar; CI pipelines that export a fresh compiler into an LTS JDK image. The error text names the exact versions expected vs found.","solutions":["Rebuild or obtain the compiler against the exact JDK you run it on (mx --java ... build) so the JVMCI versions match.","Set JVMCI_VERSION_CHECK=warn to log the mismatch and continue when you know the difference is benign.","Set JVMCI_VERSION_CHECK=ignore to suppress entirely (only for throwaway debugging).","Switch to a JDK whose JVMCI version is listed in JVMCIVersionCheck.JVMCI_MIN_VERSIONS for your target."],"exampleFix":"# before\njava -XX:+UseJVMCICompiler -cpgraal ... # InternalError: JVMCI version mismatch\n\n# after\nexport JVMCI_VERSION_CHECK=warn\njava -XX:+UseJVMCICompiler ...","handlingStrategy":"fallback","validationCode":"# Bash: verify JVMCI compatibility before launching with an exported compiler\njava -cp \"$COMPILER_JAR\" jdk.graal.compiler.hotspot.JVMCIVersionCheck --min-version \\\n  -Djava.specification.version=\"$(java -XshowSettings:properties -version 2>&1 | awk -F'= ' '/java.specification.version/{print $2}')\"","typeGuard":null,"tryCatchPattern":"try {\n    // code that loads an externally exported Graal compiler\n} catch (InternalError e) {\n    if (e.getMessage().contains(\"JVMCI_VERSION_CHECK\")) {\n        // fall back to the JDK's bundled compiler or abort with guidance\n    }\n    throw e;\n}","preventionTips":["Pin the compiler build to the JDK build in CI; run the version-check tool as a gate.","Document JVMCI_VERSION_CHECK=warn as the supported escape hatch, never 'ignore' in production."],"tags":["graalvm","jvmci","versioning","environment"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}