Note: Java with Adoptium on Linux

February 17, 2023
linux java

Recently I wrote down how to get Java installed on MacOS with the help of Adoptium. Well, it turns out, I also use Linux (Pop!_OS if you were wondering).

To install Java on Linux, go to the Adoptium page and download the tarball according to the version and your architecture. I downloaded the LTS 19 for x64:

tar xfz OpenJDK19U-jdk_x64_linux_hotspot_19.0.2_7.tar.gz
sudo mv jdk-19.0.2+7 /opt/

And now make sure that your shell can find it, my shell is Fish, so I added this snippet:

# Java installation through Adoptium
set -l java_version "19.0.2+7"
if test -d "/opt/jdk-$java_version"
    set -x JAVA_HOME "/opt/jdk-$java_version"
    fish_add_path -aP "$JAVA_HOME/bin"

Now you have Java, quickly go install Clojure :)

Faster key repeat on the Mac Espanso, text expander for Linux