How to install Oracle Java 9 in Ubuntu 16.04

Shahrukh Aslam
Oct 4, 2017 · 2 min read

This tutorial will show you step by step instructions to install Oracle Java 9 easily on Ubuntu 16.04 using PPA.

Image for post
Image for post
Java SE 9 is the latest update to the Java Platform.


  1. Open a terminal and add PPA using following command. You need sudo access to this.

Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK8 / JDK9). There are no actual Java files in this PPA. Ubuntu 16.10 Yakkety Yak is no longer supported by Canonical (and thus, Launchpad and this PPA). The PPA supports Ubuntu 17.10, 17.04, 16.04, 14.04 and 12.04.

sudo add-apt-repository ppa:webupd8team/java
Image for post
Image for post
Oracle Java installer

2. Update package repository using following command.

sudo apt-get update

3. Download and Install the installer script.

sudo apt install oracle-java9-installer
Image for post
Image for post
Oracle Binary Code License Agreement
Image for post
Image for post
In order to install this package, you must accept the license terms

4. Set Oracle JDK9 as default, to set oracle jdk9 as default, install the “oracle-java9-set-default” package. This will automatically set the JAVA env variable.

sudo apt install oracle-java9-set-default

This will complete your installation, you can check you java version by running following command.

javac -version
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store