Installation on macOS Platforms
GraalVM Enterprise can be installed for a single user and administrator privileges are not required. However, if GraalVM Enterprise is meant to become a default JDK, administrator privileges are required.
GraalVM Enterprise does not provide the installation wizard, unlike Oracle JDK
distributions for macOS that come with the .dmg download. Note that in macOS,
the JDK installation path is:
/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home
.
Follow these steps to install Oracle GraalVM Enterprise Edition on the macOS operating system:
- Navigate to Oracle GraalVM Downloads.
- Select the preferable GraalVM Enterprise version in the Release Version dropdown, 8, 11, or 17 for the Java version, and macOS for the operating system.
- Click on the GraalVM Enterprise Core download link. Before you download a file, you must accept the Oracle License Agreement in the popup window.
- When the download button becomes active, press it to start downloading **graalvm-ee-java
-darwin-amd64- .tar.gz**. - Unzip the archive:
tar -xzf graalvm-ee-java<version>-darwin-amd64-<version>.tar.gz
Alternatively, open the file in Finder.
- Move the downloaded package to its proper location, the
/Library/Java/JavaVirtualMachines
directory. Since this is a system directory,sudo
is required:sudo mv graalvm-ee-java<version>-<version> /Library/Java/JavaVirtualMachines
To verify if the move is successful and to get a list of all installed JDKs, run
/usr/libexec/java_home -V
. - There can be multiple JDKs installed on the machine. The next step is to configure the runtime environment:
- Point the
PATH
environment variable to the GraalVM Enterprisebin
directory:export PATH=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home/bin:$PATH
- Set the
JAVA_HOME
environment variable to resolve to the GraalVM Enterprise installation directory:export JAVA_HOME=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home
- Point the
- To check whether the installation was successful, run the
java -version
command.
Optionally, you can specify GraalVM Enterprise as the default JRE or JDK installation in your Java IDE.
Installation Notes
On JAVA_HOME Command
The information property file, Info.plist, is in the top level Contents folder.
This means that GraalVM Enterprise participates in the macOS-specific /usr/libexec/java_home
mechanism. Depending on other JDK 8 installation(s) available, it is now possible that /usr/libexec/java_home -v1.8
returns /Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home
.
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 sorts 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.
Supported Functionalities
The base distribution of GraalVM Enterprise for macOS platforms includes Oracle JDK with the GraalVM compiler enabled, LLVM and JavaScript runtimes. The base installation can be extended with:
Tools/Utilities:
- Native Image – a technology to compile an application ahead-of-time into a native executable
- LLVM toolchain – a set of tools and APIs for compiling native programs to bitcode that can be executed with on the GraalVM runtime
Runtimes:
- Java on Truffle – a Java Virtual Machine implementation based on a Truffle interpreter for GraalVM
- Node.js – Node.js v14.17.6 compatible
- Python – Python 3.8.5 compatible
- Ruby – Ruby 2.7.2 compatible
- R – GNU R 4.0.3 compatible
- Wasm – WebAssembly (Wasm) These runtimes are not part of the GraalVM Enterprise base distribution and must be installed separately.
To assist a user with installation, GraalVM includes GraalVM Updater, a command line utility to install and manage additional functionalities. Proceed to the installation steps to add any necessary language runtime or utility from above to GraalVM.