Installation on macOS Platforms #
GraalVM Community distributions for macOS are comprised to tar.gz file. Unlike Oracle JDK or OpenJDK distributions for macOS that comes with the .dmg download, GraalVM does not provide the installation wizard.
On the contrary to OpenJDK installations performed only on a
systemwide basis, GraalVM environment can be installed for a
single user, so administrator privileges are not required. However, if
GraalVM is meant to become a default JDK, administrator privileges
are required. The JDK installation path is
Follow these steps to install GraalVM Community on x86 64-bit macOS operating systems. For Oracle GraalVM Enterprise Edition users, find the installation instructions here.
- Navigate to GraalVM Releases repository on GitHub. Depending on the workload, select graalvm-ce-java8-darwin-amd64-20.2.0.tar.gz or graalvm-ce-java11-darwin-amd64-20.2.0.tar.gz and download. We will focus on GraalVM Community based on OpenJDK 8.
- Extract the archive to your file system. To extract it in the Downloads directory from the console, type:
~/Downloads$ tar -xvf graalvm-ce-java8-darwin-amd64-20.2.0.tar.gz
Alternatively, open the file in Finder.
- Move the obtained GraalVM to its proper location, the
/Library/Java/JavaVirtualMachinesdirectory. Since this is a system directory,
~/Downloads$ sudo mv graalvm-ce-java8-20.2.0 /Library/Java/JavaVirtualMachines
To verify if the move is successful and to get a list of all installed JDKs, run
- Since there can be multiple JDKs installed on the machine, the next step is to configure the runtime environment.
- Add the GraalVM
binfolder to the
$ export PATH=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.2.0/Contents/Home/bin:$PATH
Verify whether you are using GraalVM with the echo command:
$ echo $PATH.
- Set the
JAVA_HOMEenvironment variable to resolve to the GraalVM installation directory:
$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.2.0/Contents/Home. Please also see the notice on
$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.2.0/Contents/Home
Please also see the notice on
- Add the GraalVM
- You can specify GraalVM as the JRE or JDK installation in your Java IDE.
Note on macOS java_home command
The information property file, Info.plist, is in the top level Contents
folder. This means that GraalVM participates in the macOS specific
/usr/libexec/java_home mechanism. Depending on other JDK installation(s)
available, it is now possible that
/usr/libexec/java_home -v1.8 returns
You can run
/usr/libexec/java_home -v1.8 -V to see the complete list of 1.8
JVMs available to the
java_home command. This command appears to sort the JVMs
in decreasing version order and chooses the top one as the default for the
specified version. Within a specific version, the sort order appears to be
stable but is unspecified.
Install Additional Components #
To add support for Python, R, Ruby or WebAssembly languages interpreters in GraalVM Community Edition, use of the functional
There is a component catalog on GitHub maintained by Oracle (
gu available), from which you can install a component just by its name:
gu install ruby gu install r gu install python gu install wasm
To install GraalVM Native Image, run:
gu install native-image
To install the LLVM toolchain component, run:
gu install llvm-toolchain
Additional components may be also installed from the local components collection. For more details, proceed to the GraaVM Updater page.