Installation on macOS Platforms

On the contrary to Oracle JDK installations performed only on a systemwide basis, Oracle GraalVM Enterprise Edition can be installed for a single user, hence administrator privileges are not required. However, if GraalVM Enterprise is meant to become a default JDK, administrator privileges are required.

Note, in macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home.

Unlike Oracle JDK or OpenJDK distributions for macOS that comes with the .dmg download, GraalVM Enterprise does not provide the installation wizard. The distribution package is comprised to tar.gz file.

Follow these steps to get GraalVM Enterprise installed and ready-to-go:

  1. Navigate to the Oracle Technology Network Downloads page. Depending on the workload, select Oracle GraalVM Enterprise Edition based on JDK8 for macOS or Oracle GraalVM Enterprise Edition based on JDK11 for macOS, and accept the Oracle License Agreement.
  2. Extract the archive to your file system:
    tar -xvf <graalvm-archive>.tar.gz

    Alternatively, open the file in Finder.

  3. Move the obtained GraalVM to its proper location, the /Library/Java/JavaVirtualMachines directory. Since this is a system directory, sudo is required:
    sudo mv <graalvm> /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.

  4. Since there can be multiple JDKs installed on the machine, the next step is to configure the runtime environment.
    • Add the GraalVM bin folder to the PATH environment variable:
        export PATH=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home/bin:$PATH

      Verify whether you are using GraalVM with the echo command: $ echo $PATH.

    • Set the JAVA_HOME environment variable to resolve to the GraalVM installation directory:
        export JAVA_HOME=/Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home

      You can also specify GraalVM as the JRE or JDK installation in your Java IDE.

To check whether the installation was successful, enter java -version command.

Installation Notes

On Software Notarization

If you are using macOS Catalina and later you may need to remove the quarantine attribute from the bits before you can use them. To do this, run the following:

sudo xattr -r -d path/to/graalvm/folder/

On JAVA_HOME Command

The information property file, Info.plist, is in the top level Contents folder. This means that GraalVM Enterprise participates in the macOS-specific /usr/libexec/java_home mechanism. Depending on other JDK 8 installation(s) available, it is now possible that /usr/libexec/java_home -v1.8 returns /Library/Java/JavaVirtualMachines/<graalvm>/Contents/Home. You can run /usr/libexec/java_home -v1.8 -V to see the complete list of 1.8 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.

Install Additional Components

The base distribution of GraalVM Enterprise for macOS includes the JVM, the GraalVM compiler, the LLVM bitcode interpreter, and the JavaScript runtime with Node.js support. The base installation can be extended with:

These components are not part of the GraalVM Enterprise base distribution and must be downloaded and installed separately. The components are pre-packaged as JAR files. To assist a user with installation, GraalVM Enterprise includes GraalVM Updater, a command line utility, to install and manage additional components. Proceed to the installation steps to add a necessary component from above-listed to the GraalVM Enterprise core.