Software Engineering

How to install GraalVM on Mac

Install GraalVM with Homebrew

Homebrew is the preferred way to install anything on your Mac.

brew install graalvm/tap/graalvm-ce-java17

Install GraalVM without Homebrew

Follow these 5 steps to get GraalVM installed on your Mac.


Download the official binary:

Unpack the archive into a folder.


Move the folder into the JavaVirtualMachines directory:

sudo mv graalvm-ce-java17-21.3.0 /Library/Java/JavaVirtualMachines

sudo is required because /Library is a system directory.


Verify the installation using the java_home utility:

/usr/libexec/java_home -V
```<figure class="wp-block-image size-large">

<img decoding="async" loading="lazy" width="800" height="106" src="" alt="" class="wp-image-8283" srcset=" 800w, 300w, 768w, 954w" sizes="(max-width: 800px) 100vw, 800px" /> </figure> 

This now needs to be added to the `PATH`, but first let&#8217;s make sure we can reference the new location:

/usr/libexec/java_home -v 1.17

..should print out the newly created entry&#8217;s absolute directory path as above:


Open you `~/.bash_profile` and add:

export JAVA_HOME=$(/usr/libexec/java_home -v 1.17)
export PATH=$JAVA_HOME/bin:$PATH

### Step4:

Now to complete the installation, simply run the following:

gu install native-image

This binary is located at `/Library/Java/JavaVirtualMachines/graalvm-ce-<version>/Contents/Home/bin` if it&#8217;s not immediately available.

### Step5:

`native-image` will now be added to the path.