GraalVM Environment

An environment providing the Graal Java Virtual Machine

This notebook creates a reusable environment with the Graal JVM.

Nextjournal uses the the Graal JVM Community Edition. Note that the GraalVM version and installation directory are set as environment variables on the runtime.

GraalVM
GraalVM (Bash)
exporting environment
Type: Nextjournal
Environment:
Machine Type:
Environment Variables:
GRAAL_VERSION20.1.0
PATH/usr/local/graalvm/bin:/opt/conda/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
JAVA_VERSION11
Download this environment as a Docker image from:

Download the install tarfile.

file="graalvm-ce-java${JAVA_VERSION}-linux-amd64-${GRAAL_VERSION}.tar.gz"
path="graalvm/graalvm-ce-builds/releases/download/vm-${GRAAL_VERSION}/${file}"
url="https://github.com/${path}"
wget --progress=bar:force -P /results $url
20.0s
GraalVM (Bash)
graalvm-ce-java11-linux-amd64-20.1.0.tar.gz

Extract to the installation dir.

mkdir $GRAAL_DIR
tar -zxf 
graalvm-ce-java11-linux-amd64-20.1.0.tar.gz
\
  -C $GRAAL_DIR --strip-components=1
12.9s
GraalVM (Bash)

And test.

java -version
1.7s
GraalVM (Bash)

Install the Native Image executable.

gu install native-image
4.2s
GraalVM (Bash)
Runtimes (1)