Description
Describe GraalVM and your environment :
- GraalVM version or commit id if built from source: 23.1.1/ 24.0.0-dev
- CE or EE: CE
- JDK version: 21
- OS and OS Version: macOS
- Architecture: aarch64
- The output of
java -Xinternalversion
:
(java -Xinternalversion
shows help only; output fromjava -version
instead:)
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment GraalVM CE 21.0.1-dev+12.1 (build 21.0.1+12-jvmci-23.1-b22)
Espresso 64-Bit VM GraalVM CE 21.0.1-dev+12.1 (build 21-espresso-24.0.0-dev, mixed mode)
Have you verified this issue still happens when using the latest snapshot?
Yes.
Describe the issue
I'm using the following Maven dependencies in my library project to use GraalJS so I can execute some JavaScript code.
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>23.1.1</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<version>23.1.1</version>
<type>pom</type>
</dependency>
The code is supposed to be compatible with all Java VMs version 17 and above.
It all works fine on regular Hotspot-based VMs, apart from a separate issue on OpenJ9 (tracked in #7679). However, when running on an Espresso JVM, the following exception is thrown when launching the code:
java.lang.IllegalArgumentException: A language with id 'js' is not installed. Installed languages are: [java].
Code snippet or code repository that reproduces the issue
org.graalvm.polyglot.Context.newBuilder("js").engine(org.graalvm.polyglot.Engine.newBuilder().build()).build();
Steps to reproduce the issue
- Compile a class that executes the above code snippet.
- Run with regular GraalVM (succeeds)
- Run with OpenJDK 17 (succeeds)
- Run with GraalVM-Espresso (fails with exception)
Expected behavior
The code should execute in all three environments.
Additional context
Add any other context about the problem here. Specially important are stack traces or log output. Feel free to link to gists or to screenshots if necesary
[To redirect Truffle log output to a file use one of the following options:
* '--log.file=<path>' if the option is passed using a guest language launcher.
* '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
* Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot engine uses a fallback runtime that does not support runtime compilation to native code.
Execution without runtime compilation will negatively impact the guest application performance.
The following cause was found: JVMCI is not enabled for this JVM. Enable JVMCI using -XX:+EnableJVMCI.
For more information see: https://www.graalvm.org/latest/reference-manual/embed-languages/.
To disable this warning use the '--engine.WarnInterpreterOnly=false' option or the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
Exception in thread "main" java.lang.IllegalArgumentException: A language with id 'js' is not installed. Installed languages are: [java].
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineException.illegalArgument(PolyglotEngineException.java:129)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.throwNotInstalled(PolyglotEngineImpl.java:1173)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotEngineImpl.requirePublicLanguage(PolyglotEngineImpl.java:1180)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.requirePublicLanguage(PolyglotContextImpl.java:1705)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.lookupLanguageContext(PolyglotContextImpl.java:1667)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1676)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:60)
at org.graalvm.polyglot/org.graalvm.polyglot.Context.eval(Context.java:402)
at com.kohlschutter...