Search code examples
linuxenvironment-variablesdebiangraalvm

How do I set up GraalVM environment variable?


I do not know much about PATHs and environment variables on Linux (I use a Debian), so I've had trouble following this tutorial: https://www.graalvm.org/docs/getting-started/linux/.

So far, I seem to have been able to add

home/mendesmcmg/.rvm/bin:bin/graalvm-ce-java11-21.2.0 

to my PATH, but when I use java -version, this is the output:

openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.11+9-post-Debian-1deb10u1, mixed mode, sharing)

(no GraalVM)


Solution

  • I figured it out:

    I wasn't familliar with the terminal command pwd, so in case there are any beginners too, here's what I did:

    1. Downloaded and unziped the GraalVM file to a directory (the commands on the tutorial will work fine).

    2. On the terminal, send a pwd. This will show you the path you need to put on the environment variable. I'll call it pwd-path here, but you will replace it with what comes out of your terminal (without the brackets).

    3. Point the PATH environment to the GraalVM file, like this:

      export PATH=/[pwd-path]/graalvm-ce-java11-21.2.0/bin:$PATH

    4. Set JAVA_HOME environment variable:

      export JAVA_HOME=/[pwd-path]/graalvm-ce-java11-21.2.0

    (My version was java11-21.2.0, if you used a different one, replace it.)