Skip to content

Instantly share code, notes, and snippets.

@krisfoster
Last active March 4, 2020 13:46
Show Gist options
  • Save krisfoster/1d4cce34996a47f55e9aa124413c666b to your computer and use it in GitHub Desktop.
Save krisfoster/1d4cce34996a47f55e9aa124413c666b to your computer and use it in GitHub Desktop.
GraalVM EE 20.0.0 Version Setup Instructions

GraalVM Setup Guide

Getting Setup

Installing GraalVM

The full instructions on getting setup, can be found here, Installing .

A quick summary of this is:

  1. Download the latest version of GraalVM EE for your OS, from Download

  2. You will need to download the following packages: A. Oracle GraalVM Enterprise Edition for JDK8 (Version 20.0.0) B. Oracle GraalVM Enterprise Editipon Native Image Early Adopter based on JDK8 (Version 20.0.0) C. Oracle GraalVM Enterprise Edition Python for JDK8 (Version 20.0.0)

  3. Install the downloaded GraalVM EE. This is a tar.gz file. You will need to extract it to a location that works for you and that will then become the root of your install. I chose the following: ~/bin/graal/20.0.0

  4. Update your environment in order to add a GRAALVM_HOME and addthings to the path. You can do this by updating your shell startup script, in my case ~/.zshrc as follows:

    # Note that I am using the JDK8 version.
    export GRAALVM_HOME=~/bin/graal/20.0/graalvm-ee-java8-20.0.0
    export JAVA_HOME="${GRAALVM_HOME}"
    # Add the bin dir of GraalVM to your path, so you will be able to reference the exes
    export PATH="${GRAALVM_HOME}/bin:$PATH"
    

Testing Your Installation

Create a new shell and type the following:

```
$ java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM GraalVM EE 20.0.0 (build 25.241-b07-jvmci-20.0-b02, mixed mode)
```

Did you see the same output as above? If so, then it worked.

Test out the gu package tool:

$ gu --help

Did that work? If it did you now have access to the package tool that will allow you to install the various additional packages that come with GraalVM. We will go through a few of these shortly.

Installing Language Modules

We use the gu package tool to install the extra additional modules that you can use with GraalVm, such as the various language runtimes. In this section we will step through installing these.

Installing JS / Node

Nothing to do here, these are available by default.

You can test the node and JS tooling as follows:

$ node --help
$ js --show-version

Installing Python

Full instructions can be found here.

But the basic steps are:

  1. $ gu -L install <DOWNLOAD-LOCATION>/python-installable-svm-svmee-java8-linux-amd64-20.0.0.jar

  2. Test that Python is now installed:

     ```
     $ gu list
     # You should see that Python EE version 20.0.0 is now installed
     ```
    

Installing Native Image

There are a number of important pre-requisistes for installing native image. These are:

  1. glibc-devel
  2. zlib-devel

On Ubuntu, this can be done with:

sudo apt-get install build-essential sudo apt-get install zlib1g-dev

Full instructions can be found here, but the process is very similar to that for Python.

  1. Ensure you have the prerequisite libs available on your system: glibc-devel, zlib-devel A. On linux these can be installed using your package manager
  2. $ gu -L install <DOWNLOAD-LOCATION>/native-image-installable-svm-svmee-java8-linux-amd64-20.0.0.jar
  3. Test the installation with: native-image --version

Installing LLVM

Full instructions can be found here, but the basic steps are:

$ gu install llvm 
$ export LLVM_TOOLCHAIN=$(lli --print-toolchain-path)

Installing R

Full instructions can be found here.

When installing the R language module, it is best to consult the installation page, above, as thwere are a number of prerequisites that need to be installed.

Install Maven

For some Demos you will probably need maven installed. This should be easy to do on linux (Ubunut shown):

sudo apt install maven

Or on a Max, using Homebrew:

brew install maven

Install Visual Studio Code

A number of plugins ahve been written for this editor, that allow for better integration with the GraalVM eco-system.

You are more than welcome to use another editor. When it comes to the polyglot debugging, please make sure that you have the Google Chrome browser installed.

Install VS Code Plugins

Please install the following plugins:

  1. GraalVM Extension Pack

This will install all of the individual extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment