Oracle GraalVM is available for macOS on x64 and AArch64 architectures.
Note that in macOS, the JDK installation path is: _/Library/Java/JavaVirtualMachines/
Follow these steps to install Oracle GraalVM:
Navigate to Oracle Java Downloads. Select the preferred Oracle GraalVM version, 21 for the Java version, macOS for the operating system, and the architecture. Start downloading.
tar -xzf graalvm-jdk-<version>_macos-<architecture>.tar.gz
Alternatively, open the file in the Finder.
Note: If you are using macOS Catalina and later you may need to remove the quarantine attribute:
sudo xattr -r -d com.apple.quarantine /path/to/graalvm
sudo is required:
sudo mv graalvm-jdk-<version>_macos-<architecture> /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.
JAVA_HOME environment variable to resolve to the installation directory:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home
PATH environment variable to the GraalVM bin directory:
export PATH=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home/bin:$PATH
java -version command.Optionally, you can specify Oracle GraalVM as the default JRE or JDK installation in your Java IDE.
The information property file, Info.plist, is in the top level Contents folder.
This means that Oracle GraalVM participates in the macOS-specific /usr/libexec/java_home mechanism. Depending on other JDK 17 installation(s) available, it is now possible that /usr/libexec/java_home -v21 returns /Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home.
You can run /usr/libexec/java_home -v21 -V to see the complete list of 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.