As a prerequisite for building with GraalVM Native Image, a GraalVM JDK is required and the GRAALVM_HOME and/or JAVA_HOME environment variables need to be set.

Following are the steps needed to obtain and setup a GraalVM environment.

This is just a quick overview, and users can consult the GraalVM Getting Started section before proceeding.

1. Obtaining distribution

GraalVM distributions can be obtained from official website. Development builds might be available at releases section of official GraalVM Github page projects.

2. Setting up environment variables

After obtaining GraalVM distribution environment variable GRAALVM_HOME should be set to point to it.

This can be achieved using:

export GRAALVM_HOME=/home/${current_user}/path/to/graalvm
export GRAALVM_HOME=/Users/${current_user}/path/to/graalvm/Contents/Home
setx /M GRAALVM_HOME "C:\path\to\graalvm"
Preferably user would also set JAVA_HOME variable in the same manner (by replacing GRAALVM_HOME with JAVA_HOME in previous commands).

3. native-image tool installation

Linux / macOS
$GRAALVM_HOME/bin/gu install native-image
%GRAALVM_HOME%/bin/gu install native-image