How To Install Oracle Java 16 JDK On Ubuntu?

JDK is one of the best development environments to build applications through the Java programming languages. JDK also includes some fantastic tools to develop and test programming written in Java and run them on the Java platform. JDK delivers amazing compatibility for different platforms like Windows and Linux. You can use it on Ubuntu but follow the steps described in this article, and you will easily install Oracle Java 16 JDK on Ubuntu.

Install Oracle Java 16 JDK On Ubuntu

Step 1:

First of all, open the browser and download the JDK 16 application.

Step 2:

Open the terminal and create the directory /usr/java/oracle so that all oracle java installations store in one location. Copy the file to this folder and unzip it as follows:

These commands will install JDK to the path /usr/java/oracle/jdk-16.

Step 3:

In this step, we have to set the environment variable with the help of a command line to use the JDK installed.

Move down to the end of the page and add this file:

Now press Ctrl + O and press Enter to save our modifications.

Step 4:

In this step, we have to configure Java Commands. As seen below, we can verify the installed Java before and after running these commands:

This means that OpenJDK 15 was previously installed on your system. If you don’t have JDK installed, the messages should look like the ones below.

If your system doesn’t have JDK installed, use the instructions listed below to set up the Java commands.

Use the instructions below to modify the previously installed JDK on your computer and to install JDK 16.

Check the priority number now. We will use priority 3 to set up JDK 16. You have the option of selecting a priority based on your preferences.


So this was the simplest way to download and install Oracle Java 16 JDK on Ubuntu. Please read over each step for a better understanding since we explained everything briefly. Also, if this blog helps you, then visit our official website to learn about more blogs.

About the author

Ankit Sharma