How to Install Java 14 in Ubuntu, Debian and Linux Mint

This tutorial will guide you on how to install Java 14 Standard Edition Development Kit (JDK) in Ubuntu, Debian, and Linux Mint distributions using the PPA package and from archive sources.

Installing Java 14 Using PPA in Ubuntu, Debian, and Mint

To install the latest Java 14 version, first, add the following linuxuprising/java PPA to your system and update the repository package database as shown.

$ sudo add-apt-repository ppa:linuxuprising/java
$ sudo apt-get update

Once PPA has been added and updated, now search for the packages with the name oracle-java14-installer as shown.

$ sudo apt-cache search oracle-java14-installer

oracle-java14-installer - Oracle Java(TM) Development Kit (JDK) 14 [Output]

The above output confirms that Java 14 is available to install using the following command.

$ sudo apt-get install oracle-java14-installer

If you have more than one Java installed on your system, you can install oracle-java14-set-default package to set Java 14 as default as shown.

$ sudo apt-get install oracle-java14-set-default

Once you’ve set default Java, you can verify the installed Java version using:

$ java --version

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

Installing Java 14 from Sources in Ubuntu, Debian, and Mint

In order to install Java 14 SE SDK in your system, on a Desktop Linux machine, first open a browser and navigate to Java SE official download page.

Here, select jdk-14.0.1_linux-x64_bin.tar.gz, hit on Downloads link and check to Accept License Agreement in order to start the download process of the latest version of the tarball package.

Java offers pre-compiled packages in the form of .deb packages for Debian based Linux distributions, but we will using the gzipped tarball file to perform the installation.

If you install Java on a headless machine or in servers, download Java 14 SE JDK archive via wget command-line utility, by issuing the below command.

$ wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/14.0.1+7/664493ef4a6946b186ff29eb326336a2/jdk-14.0.1_linux-x64_bin.tar.gz

After the download completes, navigate to the directory where Java package has been downloaded and issue the below commands to start installing Java software.

The commands executed below will decompress the Java tarball archive directly into /opt directory. Enter java extracted path from /opt directory and issue an ls command to list the content of the directory. Java executable files are located in the bin directory.

$ sudo tar xfz jdk-14.0.1_linux-x64_bin.tar.gz -C /opt/
$ cd /opt/jdk-14.0.1/
$ ls
Sample Output
total 32
drwxr-xr-x  2 root  root  4096 Jun 20 14:40 bin
drwxr-xr-x  5 root  root  4096 Jun 20 14:40 conf
drwxr-xr-x  3 root  root  4096 Jun 20 14:40 include
drwxr-xr-x  2 root  root  4096 Jun 20 14:40 jmods
drwxr-xr-x 74 root  root  4096 Jun 20 14:40 legal
drwxr-xr-x  5 root  root  4096 Jun 20 14:40 lib
drwxr-xr-x  3 root  root  4096 Jun 20 14:40 man
-rw-r--r--  1 10668 10668 1263 Mar  5 16:10 release

Next, insert Java environment variables and the executable files path into your system $PATH variable, by issuing the below commands that will create a new file named java.sh into system profile.

This method ensures that Java environment variables and executables will be accessible system-wide.

$ sudo echo 'export JAVA_HOME=/opt/jdk-14.0.1/' | sudo tee /etc/profile.d/java.sh
$ sudo echo 'export PATH=$PATH:/opt/jdk-14.0.1/bin' | sudo tee -a /etc/profile.d/java.sh

Finally, log out and log in back again to apply the settings and issue the below command to verify Java installed version on your system.

$ java --version

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

Congratulations! The latest version of Java 14 SE SDK is now installed in your Debian based Linux machine.

If you read this far, tweet to the author to show them you care. Tweet a thanks
Matei Cezar
I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.