How can I install Java 8 on Ubuntu 20.04/18.04?. How to install Java 8 on Ubuntu 16.04?. It is easy to install Java 8 on Ubuntu 20.04/18.04 & Ubuntu 16.04. As of this writing, the most recent release of Java is version 11. This installation should work flawlessly on your own built PC. As a Java Developer this article will help you to install JDK in few minutes and start development work.

Java 8

We had done an article on installing Java 11 on Ubuntu:

Install Java 11 on Ubuntu

Java is the most popular class-based object-oriented programming language used mostly for building enterprise applications; both the desktop applications and backend web systems.

Programs written in Java are considered to be portable, scalable and simpler to understand. Using Java, you can make your app doing great things: from sending emails to performing Big Data analytics. Java also enjoys a huge community of users both in Github, blogs and Stack Overflow.

Install Java 8 on Ubuntu 20.04/18.04/16.04

You can install Java 8 on Ubuntu 20.04/18.04/16.04 from OpenJDK binaries available on the default upstream repositories. To do this, run the command:

sudo apt install openjdk-8-jdk

Confirm Java Version

$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Installing Java 8 from PPA repository – Doesn’t work for Ubuntu 20.04

By using Webupd8 Team’s PPA repository, Java 8 can be installed using apt command. But first, the repository needs to be added to your Ubuntu system.

sudo add-apt-repository ppa:webupd8team/java
sudo apt update

When the repository is added, install Java 8 by executing the following command in your terminal.

sudo apt install oracle-java8-installer

To install Java 8 and make the the default on the fly, run the following command instead.

sudo apt install oracle-java8-set-default


Set Default Java version

If you keep switching between different versions of Java, here is a guide for you on how to do it properly.

How to set default Java version on Ubuntu / Debian

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here