Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Java 9 include Graal?

I'm reading JEP 317. It says that Graal (a new experimental Java-based JIT compiler) will be part of JDK 10, but then it says that is already available in JDK 9. So, what's the point of JEP 317 then? Does Java 9 include Graal or not?

like image 672
ZhekaKozlov Avatar asked Jan 14 '18 18:01

ZhekaKozlov


People also ask

What is Graal JVM?

GraalVM is a tool for developers to write and execute Java code. Specifically, GraalVM is a Java Virtual Machine (JVM) and Java Development Kit (JDK) created by Oracle. It is a high-performance runtime that provides improvements in application performance and efficiency.

Is GraalVM better than JVM?

Run Java Faster GraalVM takes over the compilation of Java bytecode to machine code. In particular for other JVM-based languages such as Scala, this configuration can achieve benefits, as for example experienced by Twitter running GraalVM in production.

Is GraalVM a compiler?

Besides the Truffle framework, GraalVM incorporates its optimizing compiler into an advanced ahead-of-time (AOT) compilation technology – Native Image – which translates Java and JVM-based code into a native platform executable.


1 Answers

From one of my memos, on linux-x64 (out-of-the-box) to use Graal on JDK 9, you can enable it using :

-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler

Source: Tweet from Chris.


If you're explicitly willing to make use of the org.graalvm.* classes, they are not present in the JDK-9 build except for the Linux distribution here and the JEP-317#Experimental Java-Based JIT Compiler's status also reads something similar.

Status    Integrated
Scope JDK
Release   10

Update:- To use Graal on JDK10, one can enable it using:-

-XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler -Djvmci.Compiler=graal
like image 131
Naman Avatar answered Oct 21 '22 08:10

Naman