DEV Community

Maksim
Maksim

Posted on • Originally published at maksimrv.Medium on

2 2

Install GraalVM on macOS M1

We can download required version of GraalVM using curl

curl --create-dirs --output-dir ~/Library/Java/JavaVirtualMachines -OL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java17-darwin-amd64-22.0.0.2.tar.gz
Enter fullscreen mode Exit fullscreen mode

This command will download graalvm-ce-java17-darwin-adm64-22.0.0.2.tar.gz to ~/Library/Java/JavaVirtualMachines. Now we should extract archive’s content by tar

tar xvzf graalvm-ce-java17-darwin-amd64-22.0.0.2.tar.gz
Enter fullscreen mode Exit fullscreen mode

Now we can add GRAALVM_HOME environment variables to .bashrc or .zshrc

export GRAALVM_HOME ="$HOME/Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.0.0.2/Contents/Home"
Enter fullscreen mode Exit fullscreen mode

also, we can add GraalVM bin folder to the PATH . This allows us to easily access executable commands from shell

export PATH="$GRAALVM_HOME/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Now we can easily install native-image using gu command

gu install native-image
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

DEV shines when you're signed in, unlocking a customized experience with features like dark mode!

Okay