Skip to content

Java 13 not working with GraalVM and -XX:+EnableJVMCI #1751

@nhartner

Description

@nhartner

Running latest Java 13 SE from https://www.oracle.com/technetwork/java/javase/downloads/index.html, attempting to run with VM args -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI causes calls to org.graalvm.polyglot.Context.create("js") to fail with the following error:

Exception in thread "main" java.lang.InternalError: java.lang.IllegalAccessException: class com.oracle.truffle.api.impl.DefaultTruffleRuntime$Loader cannot access class jdk.vm.ci.services.Services (in module jdk.internal.vm.ci) because module jdk.internal.vm.ci does not export jdk.vm.ci.services to unnamed module @27f674d
	at com.oracle.truffle.api.impl.DefaultTruffleRuntime$Loader.load(DefaultTruffleRuntime.java:262)
	at com.oracle.truffle.api.impl.DefaultTruffleRuntime.getCapability(DefaultTruffleRuntime.java:235)
	at com.oracle.truffle.api.impl.TruffleLocator.loaders(TruffleLocator.java:74)
	at com.oracle.truffle.api.impl.Accessor.loaders(Accessor.java:109)
	at com.oracle.truffle.polyglot.EngineAccessor.allLoaders(EngineAccessor.java:97)
	at com.oracle.truffle.polyglot.LanguageCache.createLanguages(LanguageCache.java:246)
	at com.oracle.truffle.polyglot.LanguageCache.languages(LanguageCache.java:237)
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.languages(PolyglotEngineImpl.java:578)
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.initializeLanguages(PolyglotEngineImpl.java:526)
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.<init>(PolyglotEngineImpl.java:198)
	at com.oracle.truffle.polyglot.PolyglotEngineImpl.<init>(PolyglotEngineImpl.java:180)
	at com.oracle.truffle.polyglot.PolyglotImpl.buildEngine(PolyglotImpl.java:180)
	at org.graalvm.polyglot.Engine$Builder.build(Engine.java:505)
	at org.graalvm.polyglot.Context$Builder.build(Context.java:1406)
	at org.graalvm.polyglot.Context.create(Context.java:700)
	at test.App.main(App.java:49)
Caused by: java.lang.IllegalAccessException: class com.oracle.truffle.api.impl.DefaultTruffleRuntime$Loader cannot access class jdk.vm.ci.services.Services (in module jdk.internal.vm.ci) because module jdk.internal.vm.ci does not export jdk.vm.ci.services to unnamed module @27f674d
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:376)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:642)
	at java.base/java.lang.reflect.Method.invoke(Method.java:559)
	at com.oracle.truffle.api.impl.DefaultTruffleRuntime$Loader.load(DefaultTruffleRuntime.java:260)
	... 15 more

This works fine with Java 11 and 12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions