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"

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 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/
$ sudo echo 'export PATH=$PATH:/opt/jdk-14.0.1/bin' | sudo tee -a /etc/profile.d/

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.

Tutorial Feedback...
Was this article helpful? If you don't find this article helpful or found some outdated info, issue or a typo, do post your valuable feedback or suggestions in the comments to help improve this article...

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.