java, ubuntu,

Install Oracle Java 8, 9 in Ubuntu 16.04

Shaukat Mahmood Ahmad Shaukat Mahmood Ahmad Follow Mar 10, 2019 · 1 min read
Install Oracle Java 8, 9 in Ubuntu 16.04
Share this

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


  1. PPA (Personal Package Archives) let you to upload Ubuntu source packages to be built and published as an apt repository $\hookleftarrow$
Join Newsletter
Get the latest news right in your inbox. We never spam!
Shaukat Mahmood Ahmad
Written by Shaukat Mahmood Ahmad Follow
Hi, I am Shaukat Mahmood Ahmad, the author of SMA's blog and CTO / Co Founder at