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. The JVM is a program made to execute code. It allows Java programs to run on any device or operating system. The JDK is a software development environment that allows users to create Java-native applications that can be executed and run by the JVM, as well as a Java Runtime Environment (JRE).

The goals of GraalVM include: improving the performance of languages based in JVM, reducing JVM-based application startup times, integrating into the Oracle Database, mixing different types of code into a single program, as well as providing an extended set of programming tools to do so. Essentially, GraalVM allows developers to run code efficiently, embed other languages with the GraalVM software development kit (SDK) and use a single tool set to monitor, profile and debug code.

Besides supporting Java code, Graal also supports additional programming languages and execution modes such as Python, JavaScript, Ruby, Scala, Groovy and Kotlin.

How does GraalVM work? 

GraalVM is written for the Java ecosystem and has a Java framework based on the Truffle Language Implementation framework. The tool contains a virtualization layer that allows the execution of guest programming languages with host GraalVM languages. These languages can be used in the same runtime. The main language and guest languages can interoperate with each other directly, as well as pass data back and forth in system memory. Interoperability refers to the ability for the languages to natively interact as one system. Native code is executed through a combination of an LLVM front end and WebAssembly programs on the JVM.

GraalVM can also run as a stand-alone tool, or with other platforms such as OpenJDK or Node.js. Because GraalVM was developed by Oracle Labs, it can also execute inside Oracle databases.

Components of GraalVM 

Among others, three general components make up the core of GraalVM; runtimes, libraries and utilities. Runtimes include the Java HotSpot VM and Node.js runtimes. Java HotSpot VM works in conjunction with the GraalVM compiler, whereas the Node.js runtime works in conjunction with the GraalVM JavaScript interpreter.

Libraries are a collection of similar objects -- like programs or code -- that are stored for occasional use. Libraries used in GraalVM come in the form of jar files and include the GraalVM compiler, script interpreter, LLVM bitcode interpreter and the GraalVM Polyglot API.

Utilities used include the LLVM bitcode interpreter command-line tool, JavaScript REPL and an updating tool used to install and manage other components.

Other, more specific components include:

  • The GraalVM compiler. A just-in-time compiler.
  • GraalVM Native Image. Used for ahead-of-time compilation. It can execute multiple language types.
  • Support with instrumentation-based tools. Can use APIs to provide tools such as a language-agnostic debugger, profiler and heap viewer.

Optional components can also be used to expand GraalVM's use. These include interpreters for different languages such as for Python, Ruby or R.

GraalVM installation 

GraalVM 20.0.0 has two different offerings: Community Edition and Enterprise Edition. Both editions are designed to work for Windows, Linux and macOS platforms and on x86 64-bit systems. Most builds of GraalVM are based on either JDK 8 or 11.

GraalVM also comes packaged with JavaScript and a package manager. The package manager, called gu, lets users install other languages. These components can be downloaded from GitHub.

Along with current versions of GraalVM that are available for download, new versions are currently being worked on, such as the graalvm-ce-java11-linux-aarch64-20.0.0 bundle available for testing on GitHub.

GraalVM pricing

Pricing for GraalVM depends on the version being used. The Community Edition is open sourced, so it is free -- although individual components can be licensed. This edition is built from sources available on GitHub. The price of the enterprise edition may vary depending on the license. Specifically, subscription prices will depend on the subscription metric and volume -- for example, the number of processors used. The licenses include the GraalVM OTN License Agreement or the Oracle Master License Agreement. The GraalVM OTN License Agreement is free for evaluation, testing and for developing nonproduction applications.

History of GraalVM 

The name Graal came from the GraalVM compiler that's used by the tool. The compiler was designed to be implemented once and written as a library that could handle many different tasks. The first production-ready version of GraalVM was version 19.0, announced and released by Oracle in May 2019. In February 2020, GraalVM 20.0.0 was released. This version focused on improving its support for Windows systems, as well as introduced an enhanced native-image tool and improved the tooling support. Changes were also made to the compiler and the supported languages.

This was last updated in May 2020

Continue Reading About GraalVM

Dig Deeper on JVM languages - Scala, Groovy, Grails, Jruby

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.


File Extensions and File Formats