Installation on macOS Platforms #
GraalVM Community Edition can be installed for a single user and administrator privileges are not required. However, if GraalVM is meant to become a default JDK, administrator privileges are required.
GraalVM Community Edition does not provide the installation wizard, unlike OpenJDK
distributions for macOS that come with the .dmg download.
It can be installed from an archive file (.tar.gz).
Note that in macOS, the JDK installation path is:
Follow these steps to install GraalVM Community on the macOS operating system:
- Navigate to GraalVM Releases repository on GitHub. Depending on the workload, select Java 11 based or Java 8 based distribution for macOS, and download.
- Unzip the archive.
tar -xzf graalvm-ce-java<version>-darvin-amd64-<version>.tar.gz
Alternatively, open the file in Finder.
Note: If you are using macOS Catalina and later you may need to remove the quarantine attribute. See Installation Notes below.
- Move the downloaded package to its proper location, the
/Library/Java/JavaVirtualMachinesdirectory. Since this is a system directory,
sudo mv graalvm-ce-java<version>-<version> /Library/Java/JavaVirtualMachines
To verify if the move is successful and to get a list of all installed JDKs, run
- There can be multiple JDKs installed on the machine. The next step is to configure the runtime environment:
- Point the
PATHenvironment variable to the GraalVM
- Set the
JAVA_HOMEenvironment variable to resolve to the GraalVM installation directory:
- Point the
- To check whether the installation was successful, run the
Optionally, you can specify GraalVM as the default JRE or JDK installation in your Java IDE.
For Oracle GraalVM Enterprise Edition users, find the installation instructions here.
Installation Notes #
On Software Notarization
If you are using macOS Catalina and later you may need to remove the quarantine attribute from the bits before you can use them. To do this, run the following:
sudo xattr -r -d com.apple.quarantine /path/to/GRAALVM_HOME
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
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 #
- 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
- Java on Truffle – a Java Virtual Machine implementation based on a Truffle interpreter for GraalVM
- Node.js – Node.js 14.16.1 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 Community 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.