How To Install Oracle JDK 9 on CentOS 7

Install Oracle JDK 9 on CentOS 7

There are many programs and scripts that require java to run it, but usually Java is not installed by default on VPS or Dedicated Server. This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Oracle JDK 9 on CentOS 7.

Install Oracle JDK 9 on CentOS 7

Step 1. First, remove the Java 1.6 or 1.7 have been installed already, you can uninstall them using the following commands.

Step 2. Downloading and Installing Oracle JDK 9 on CentOS 7.

First, go to Java 9 official website of Oracle, select the appropriate version and then download:

Next, change the directory to the location where you want to install the JDK, then move the .tar.gz archive binary to the current directory:

Step 3. Install JAVA using alternatives.

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package:

At this point JAVA 9 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives:

Step 4. Checking Installed java version.

Step 5. Setup global environment variables.

We can easily set the environment variables using the export command as shown below:

Setup JAVA_HOME Variable:

Setup JRE_HOME Variable:

Congratulation’s! You have successfully installed Oracle JDK 9. Thanks for using this tutorial for installing Oracle JDK 9 on CentOS 7 systems. For additional help or useful information, we recommend you to check the official Oracle web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!

Save