#14540·graal

[Native Image] GraalJITCompileAtRuntime fails to build with the Truffle runtime: hosted graph builder plugins reachable through Truffle.RUNTIME

Author: sgammonCreated Sep 27, 2026Updated Sep 27, 2026

Describe the Issue

-H:+GraalJITCompileAtRuntime (JIT compilation of bytecode loaded at run time by Crema) cannot be combined with the Truffle runtime: the image build fails because hosted-only graph builder plugins become reachable in the image heap through the Truffle compiler's configuration (Truffle.RUNTIME → SubstrateTruffleRuntime.truffleCompiler → TruffleCompilerImpl.config → TruffleCompilerConfiguration.plugins → GraphBuilderConfiguration$Plugins).

A plain application builds fine with the same flags; any image containing truffle-runtime fails, before any language code is involved.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

Reproduced with both:

openjdk version "25.0.4.1.1" 2026-08-18
OpenJDK Runtime Environment GraalVM CE 25.4.4.1.1+1.1 (build 25.0.4.1.1+1-jvmci-25.4-b23)
OpenJDK 64-Bit Server VM GraalVM CE 25.4.4.1.1+1.1 (build 25.0.4.1.1+1-jvmci-25.4-b23, mixed mode, sharing)
java version "25.0.4.1.1" 2026-08-18 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 25.4.4.1.1-dev+1.1 (build 25.0.4.1.1+1-LTS-jvmci-25.4-b23)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25.4.4.1.1-dev+1.1 (build 25.0.4.1.1+1-LTS-jvmci-25.4-b23, mixed mode, sharing)

(Also reproduced on Oracle GraalVM 25.3.4.1.)

Operating System and Version

Linux x86_64

Troubleshooting Confirmation

Run Command

native-image -H:+UnlockExperimentalVMOptions -H:+RuntimeClassLoading -H:+GraalJITCompileAtRuntime -cp classes:$TRUFFLE_CP Main -o main

Expected Behavior

The image builds, and Truffle runtime compilation keeps working alongside JIT compilation of runtime-loaded bytecode (or the build rejects the combination with a clear message if it is unsupported).

Actual Behavior

The build fails during analysis with UnsupportedPlatformException: Type is not available in this platform for hosted plugin types (SubstitutionInvocationPlugins, SubstrateClassInitializationPlugin, DevirtualizeInterfaceCallPlugin).

Steps to Reproduce

  1. Main.java:
    java
    public final class Main {
        public static void main(String[] args) {
            System.out.println(com.oracle.truffle.api.Truffle.getRuntime().getName());
        }
    }
  2. Compile against the 25.4.4.1.1 Maven artifacts truffle-api, truffle-runtime, truffle-compiler, polyglot, collections, word, nativeimage, jniutils ($TRUFFLE_CP).
  3. Build with -H:+RuntimeClassLoading only: succeeds, and the binary prints the runtime name.
  4. Build with -H:+RuntimeClassLoading -H:+GraalJITCompileAtRuntime: fails as below.
  5. A hello-world without Truffle on the class path builds with -H:+RuntimeClassLoading -H:+GraalJITCompileAtRuntime.

Additional Context

No response

Build-Time Log Output and Error Messages

CE 25.4.4.1.1:

Error: com.oracle.graal.pointsto.constraints.UnsupportedPlatformException: Type is not available in this platform: com.oracle.svm.hosted.substitute.SubstitutionInvocationPlugins
Object was reached by
  reading field jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration$Plugins.invocationPlugins of constant 
    jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration$Plugins@71fc3b0f: jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration$Plugins@71fc...
  reading field jdk.graal.compiler.truffle.TruffleCompilerConfiguration.plugins of constant 
    jdk.graal.compiler.truffle.TruffleCompilerConfiguration@7ddb5435: jdk.graal.compiler.truffle.TruffleCompilerConfiguration@7ddb5435
  reading field jdk.graal.compiler.truffle.TruffleCompilerImpl.config of constant 
    com.oracle.svm.truffle.api.SubstrateTruffleCompilerImpl@26e61207: com.oracle.svm.truffle.api.SubstrateTruffleCompilerImpl@26e61207
  reading field com.oracle.truffle.runtime.OptimizedTruffleRuntime.truffleCompiler of constant 
    com.oracle.svm.truffle.api.SubstrateTruffleRuntime@4a9a0913: com.oracle.svm.truffle.api.SubstrateTruffleRuntime@4a9a0913
  reading static field com.oracle.truffle.api.Truffle.RUNTIME
    at <unknown-location>
(similar paths follow for SubstrateClassInitializationPlugin and DevirtualizeInterfaceCallPlugin)