How to Install Oracle Java 9 on CentOS 7

r00t March 14, 2018

Install Oracle Java 9 on CentOS 7

In this tutorial we’ll learn how to install Oracle Java 9 on CentOS 7. We will also install and configure its prerequisites. There are two standard types of installations, JRE (Java Runtime Environment) and JDK (Java Development Kit). Like the base model car, JRE enables the ability to create Java Applications for different types of deployments using minimal core tools to accomplish the task. JDK is a fully loaded Development Kit that has everything that JRE has plus additional resources to create/secure Applications and Applets.

I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.

Install Oracle Java 9 on CentOS 7

Step 1. First, ensure your system is fully up-to-date by running the following:

yum -y update

Step 2. Installing Java.

  • Install Java 9 from archive binaries.

Download the archive binary by using wget command as follows:

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/9+181/jdk-9_linux-x64_bin.tar.gz \
-O jdk-9_linux-x64_bin.tar.gz

Change the directory to the location where you want to install the JDK:

sudo mv jdk-9_linux-x64_bin.tar.gz /opt/
cd /opt/
sudo tar -xzf jdk-9_linux-x64_bin.tar.gz

Set up Java Environment Variables:

export JAVA_HOME=/opt/jdk-9
export PATH="$PATH:$JAVA_HOME/bin"

To verify the installation, we can run the following command:

java -version
  • Install Java 9 from RPM packages.

First, download the Java 9 RPM package from its official website or simply use the wget command as follows:

wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/9+181/jdk-9_linux-x64_bin.rpm \
-O jdk-9_linux-x64_bin.rpm

Install the package using the following command:

rpm -ivh jdk-9_linux-x64_bin.rpm

To verify the installation, we can run the following command:

java -version

Set up Java Environment Variables:

export JAVA_HOME=/usr/java/jdk-9/
export PATH="$PATH:$JAVA_HOME/bin"

Congratulation’s! You have successfully install and configured Monitorix on your CentOS 7 server. Thanks for using this tutorial for installing Monitorix open source tool monitor system on CentOS 7 system.

Save

The Tags:

Leave a Comment

Comments are closed.