This comprehensive Linux guide expects that you run the following commands as root user but if you decide to run the commands as a different user then ensure that the user has sudo access and that you precede each of the privileged commands with sudo

Java is one of the world’s most popular programming language. Java SE 9 is the result of an industry-wide development effort involving open review, weekly builds, and extensive collaboration between Oracle engineers and members of the worldwide Java developer community via the OpenJDK Community and the JCP.

In this tutorial, we will guide you about how to install java 9 JDK/JRE on Debian/Ubuntu

Updating Repository Database

To install Java 9 JDK/JRE on your debian/ubuntu system, you first need to update your repository package database by running the following commands:

root@codesposts:~$ add-apt-repository ppa:webupd8team/java

root@codesposts:~$ apt-get update

Installing Java 9

After adding the PPA and updating, run the following command to install the java 9 JDK/JRE on your debian/ubuntu system.

root@codesposts;~$ apt-get install oracle-java9-installer

Making Java 9 Default

If more than one versions of Java are installed on your system, you can make the Java 9 default by running the following command:

root@codesposts:~$ apt-get install oracle-java9-set-default

Verifying The Version

You can verify the Java 9 version installed on your system by running the following command:

root@codesposts:~$ java --version

java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)