-
Notifications
You must be signed in to change notification settings - Fork 0
Using Graal in JDK 9 EA Builds
JRuby+Truffle is designed to be run with a JVM that has the Graal compiler. The easiest way to get this is by downloading the [GraalVM](Downloading GraalVM), but it also possible to use Graal with JDK 9 EA (early access) builds.
The JDK EA builds lag behind Graal development a bit so the interfaces are not always compatible. This will stabilise over time. I believe at the moment they are unfortunately incompatible. When they are compatible in the future, this is how it should work. You'll need to download a JDK 9 EA build.
https://jdk9.java.net/download/
You will also need a copy of graal.jar. You can [build this yourself](Building Graal) or get it from [a download of GraalVM](Downloading GraalVM).
To use the EA build of Java to run JRuby+Truffle, set the JAVACMD environment variable. You will also need to pass several other command line options.
$ JAVACMD=path/to/jdk9/bin/java bin/jruby.bash -X+T \
-J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableJVMCI \
-J-Djvmci.compiler=graal \
-J-Xbootclasspath/p:graal.jar \
...
-
-J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableJVMCIenables JVMCI - the interface that Graal uses -
-J-Djvmci.compiler=graaltells JVMCI to use Graal -
-J-Xbootclasspath/p:graal.jarputs Graal on the boot classpath, where it needs to be in order to be used by JVMCI