The Nextjournal GraalVM Environment

This notebook builds a reusable environment with the Graal JVM, based on the minimal Bash environment. Nextjournal uses the the Graal JVM Community Edition, off of GitHub. Note that the GraalVM version and installation directory are set as environment variables on the runtime.

GraalVM
GraalVM (Bash)
exporting environment
Type: Nextjournal
Environment:
Resources:
Environment Variables:
GRAAL_VERSION19.1.1
PATH/usr/local/graalvm/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GRAAL_DIR/usr/local/graalvm
Download this environment as a Docker image from:

Download the install tarfile.

TARFILE="graalvm-ce-linux-amd64-${GRAAL_VERSION}.tar.gz"

wget --progress=bar:force -O graal.tgz \
 https://github.com/oracle/graal/releases/download/vm-${GRAAL_VERSION}/${TARFILE}

Extract to the installation dir, delete download.

mkdir $GRAAL_DIR
tar -zxf graal.tgz -C $GRAAL_DIR --strip-components=1
rm graal.tgz

And test.

java -version

Install the Native Image executable.

gu install native-image