Install GraalVM and Native-Image on an M1 Mac (Java11)

This is a quick guide on installing GraalVM on your M1 Mac – this guide also works for x86_64 Macs also.

This will install GraalVM for Java11 – different Java versions are available here:

Install GraalVM using Homebrew

brew install --cask graalvm/tap/graalvm-ce-java11

export JAVA_HOME=$HOME/Library/Java/JavaVirtualMachines/graalvm-ce-java11-

Give GraalVM permission to run

xattr -r -d /Library/Java/JavaVirtualMachines/graalvm-ce-java11-

Install using sdkman

SDKMAN is a brilliant tool, you can install it here:

sdk install java

export JAVA_HOME=$HOME/.sdkman/candidates/java/

Install native-image plugin

Firstly update your path

Brew version:

export PATH=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-"$PATH"

SDKMAN version:

export PATH=$HOME/.sdkman/candidates/java/"$PATH"

You can now install the native-image plugin via the gc command.

gu install native-image

Leave a Reply