Use this tutorial to install OpenJDK Java 8 on Ubuntu 19.10, 18.04 LTS, 16.04 LTS, LinuxMint 19, 18 using PPA. Follow the below steps to install Java 8 on Ubuntu via the command line.

Step 1 – Install Java 8 on Ubuntu

The OpenJDK 8 is available under default Apt repositories. You can simply install Java 8 on an Ubuntu system using the following commands. Run below commands to install Java 8 on Ubuntu and LinuxMint.

Step 2 – Verify Java Installation

You have successfully installed Java 8 on your system. Let’s verify the installed and current active version using the following command.

Step 3 – Setup JAVA_HOME and JRE_HOME Variable

As you have installed Java on your Linux system, You must have to set JAVA_HOME and JRE_HOME environment variables, which is used by many of the Java applications to find Java libraries during runtime. You can set these variables in /etc/environment file using the following command. All done, you have successfully installed Java 8 on a Linux system. You may also need to install Tomcat server to run your Java web application. Use our another tutorial to Install Tomcat 7 or Install Tomcat 8 or Install Tomcat 9 on Ubuntu, Debian, and LinuxMint systems.