How to install Java 13 on Ubuntu 18.04.3? (Works in 20.04 too)

How to install Java 13 on Ubuntu 18.04.3 from terminal with sudo privildges?

2

1 Answer

Followed per Pilot6 comment (thanks).

JDK 9 & Later

Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives.

As an example, the archives for JDK 13 may be found on and may be extracted on the command line using

$ tar xvf openjdk-13*_bin.tar.gz

Commands to download java 15 from jdk net (Linux / x64) using terminal and saving to a folder in Downloads folder called 'j'. ~ is shortcut for current logged in user's home directory

mkdir ~/Downloads/j
cd ~/Downloads/j
curl --output ./jdk_15.0.2_linuxx64bin.tar.gz tar xvf j16.tar.gz

Used sudo mv to move directory 'jdk-13.0.1' to /usr/lib/jvm/

 sudo mv jdk-16 /usr/lib/jvm/

Then in my ~/.profile file added/edited (as I had Java 11 before) in text editor:

export JAVA_HOME=/usr/lib/jvm/jdk-13.0.1
export PATH=$JAVA_HOME/bin:$PATH

In the current terminal gave above two commands and could use Java 13. Worked after restart too due to entry in ~/.profile

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like