Ubuntu

Install Latest Java OpenJDK/JRE 11/13/14/15 on Ubuntu


The Java Runtime Environment (JRE) and Java Development Kit (JDK) are OpenJDK packages. The JRE includes Java virtual machine (JVM), classes, and binary files that are necessary to run the Java program. On the other hand, JDK contains JRE and other debugging and development tools. Download and install JDK if you are focused on creating Java applications. The new versions of Java are released gradually. At the time of preparing this post, JDK 11 is the latest long-term support (LTS) release, whereas 13, 14, and 15 are the feature releases of Java. The JDK 12 has been superseded because it does not include the most up to date security vulnerability fixes and is no longer recommended for use in production.

For instance, if you are not sure which java package you should install, then it is suggestted to install JDK 11.

We are using Ubuntu 20.04 for installing the latest java versions.

Install OpenJDK 11

The OpenJDK 11 is included in the Ubuntu 20.04 base repository. Update the package listing before installing OpenJDK 11 using:

$ sudo apt update

Now, install OpenJDK with the command:

$ sudo apt install openjdk-11-jdk

The OpenJDK 11 LTS will be installed successfully.

Install OpenJDK 13

The OpenJDK 13 is available from the Ubuntu 20.04 default repository and can be installed using the command:

$ sudo apt install openjdk-13-jdk

Install OpenJDK 14

The OpenJDK 14 is available from the Ubuntu 20.04 default repository and can be installed using the command:

$ sudo apt install openjdk-14-jdk

Install OpenJDK 15

Released on 15 September 2020, the OpenJDK 15 is the latest feature release of JDK. But it is not the part of Ubuntu 20.04 base repository.

To install OpenJDK 15, download its Debian package from the Oracle official website (https://www.oracle.com/java/technologies/javase-jdk15-downloads.html).

The downloaded Debian Package will be saved in the Downloads directory. Navigate to the Downloads directory:

$ cd Downloads/

Next, install OpenJDK 15 through the Debian package using the apt command:

$ sudo apt install ./jdk-15.0.1_linux-x64_bin.deb

Verify the OpenJDK installed version

Once you have installed your desired OpenJDK version on Ubuntu 20.04, you can then verify or check the installed version using:

$ java --version

Conclusion

To run and use Java in any environment, we need to install JDK. The OpenJDK 11 is the LTS release, whereas Java 13, 14, and 15 are the feature releases. This post describes how to install OpenJDK 11, 13, 14, and 15 on Linux, especially Ubuntu 20.04.

About the author

Kamran Sattar Awaisi

I am a software engineer and a research scholar. I like to write article and make tutorial on various IT topics including Python, Cloud Computing, Fog Computing and Deep Learning. I love to use Linux based operating systems.