Install Oracle Java JDK 9 on Ubuntu 16.04 | 17.10 | 18.04 via PPA

If you’re going to be developing any kind of Java applications on Ubuntu, you’re definitely going to need Java JDK / JRE installed… the steps below show you how to get Oracle Java JDK 9 / JRE via PPA on Ubuntu 16.04 | 17.10 | 18.04 installed…

Oracle Java JDK is a development environment for developing applications and tools based on Java. It can also be used for testing applications and program developed using the Java programming language.

This brief tutorial is going to show students and new users how to download Oracle Java JDK / JRE and install on Ubuntu 16.04 | 17.10 | 18.04 LTS…

There’s also an alternative open source version of JAVA JDK, however, many applications already developed still rely on the Oracle version of the software…

To install Java JDK, follow the steps below:

Step 1: Add A Third Party PPA to Ubuntu

The easiest way to install Oracle Java JDK 9 on Ubuntu is via a third party PPA… To add that PPA, run the commands below

sudo add-apt-repository ppa:webupd8team/java

After running the commands above, you should see a prompt to accept the PPA key onto Ubuntu… accept and continue

Continue below to install Java 9…

Step 2: Download Oracle Java 9 Installer

Now that the PPA repository has been added to Ubuntu, run the commands below to download Oracle Java 9 installer…. the installer should install the latest Java JDK 9 on your Ubuntu machines.

sudo apt update
sudo apt install oracle-java9-installer

When you run the commands above you’ll be prompted to access the license terms of the software… accept and continue..

oracle java 9

Step 3: Configure Oracle JDK9 as Default

Set Oracle JDK9 as default, to do that, install the oracle-java9-set-default package. This will automatically set the JAVA env variable.

sudo apt install oracle-java9-set-default

The command above will automatically set Java 9 as the default… and that should complete your installation, you can check you java version by running following command.

javac -version

That’s it! You have successfully installed Oracle Java JDK 9 on Ubuntu 16.04 | 17.10 | 18.04 via PPA

Enjoy!

You may also like the post below:

Install Drupal CMS on Ubuntu 16.04 / 17.10 / 18.04 with Nginx, MariaDB, PHP 7.2 and Let’s Encrypt SSL/TLS Certificates

5 Replies to “Install Oracle Java JDK 9 on Ubuntu 16.04 | 17.10 | 18.04 via PPA

  1. sudo add-apt-repository ppa:webupd8team/java is no longer working. I can’t seem to find any other way to get java installed and ready to use for development. Is there a work around?

    1. Dunno what happened, really. But the default-jdk in Ubuntu 18.04 runs with OpenJDK 11 at the moment (“sudo apt-get install -y default-jdk”). That’s fine with me!

  2. Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package oracle-java9-installer is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘oracle-java9-installer’ has no installation candidate

Leave a Reply to maddhatter Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.