Install Oracle Java 8, 9 in Ubuntu 16.04

In this article I will explain how to install Oracle Java on Ubuntu 16.04 LTS Server. I will explain the installation process of both Oracle Java 8 and 9.

1. Add the PPA

Run following command to add Webupd8team1 PPA repository.

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

2. Update Package Lists

Run following command to update apt package lists.

$ sudo apt update

3. Install Oracle Java 8 installer script

Run following command to run Oracle Java 8 installer script.

$ sudo apt install oracle-java8-installer

To install Java 9 replace oracle-java8-installer with oracle-java9-installer.

4. Verify Java installation

Run following command to verify Java 8 installation.

Verify Java runtime (JRE) version.

$ java -version

Verify Java compiler (JDK) version.

$ javac -version

Footnotes

  1. PPA (Personal Package Archives) let you to upload Ubuntu source packages to be built and published as an apt repository 

Shoket Mahmood Ahmed

Leave a Reply

Back to top