Download a specific version from the Releases page (https://github.com/graalvm/graalvm-ce-builds/releases). Note you should not take the latest by default, as Quarkus does not always support the latest version.
Unzip and move to JVM directory
sudo mv ~/Downloads/graalvm-ce-java8-20.0.0 /Library/Java/JavaVirtualMachines
/usr/libexec/java_home -V
# note the uppercase V
Sample output:
Matching Java Virtual Machines (4):
11.0.6, x86_64: "GraalVM CE 20.0.0" /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.0.0/Contents/Home
1.8.0_241, x86_64: "GraalVM CE 20.0.0" /Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.0.0/Contents/Home
1.8.0_231, x86_64: "GraalVM CE 19.2.1" /Library/Java/JavaVirtualMachines/graalvm-ce-19.2.1/Contents/Home
1.8.0_202, x86_64: "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
/usr/libexec/java_home -v 1.8.0_241
# note the lowercase v
, 1.8.0_241 is the label for the JVM from the command above.
run java -version
to see if the default JVM has been set up. If you get a MacOS security warning, run the next step, otherwise skip it.
GraalVM is currently not notarized for MacOS and needs to be removed from quarantine using the following command:
xattr -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.0.0
Add the JVM to your path.
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.0.0/Contents/Home
export PATH=$GRAALVM_HOME:$PATH
Run the command below to install the native image (used for building native images of your Quarkus apps):
/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.0.0/Contents/Home/bin/gu install native-image