How to remove OpenJDK and install Oracle JDK

This article outlines a procedure that can be used to uninstall OpenJDK and install Oracle JDK in preparation of a host for installing CafeX software. Note that the procedure has been verified in RHEL 6.4 64bit minimal server. A google search for "how to remove OpenJDK and install Oracle JDK" will yield many other sources of excellent information. The step by step commands are listed after a short video.


Step 1. What JDK version is installed?

The output from java -version will display the currently installed java version.

# java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (rhel- u55-b13)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

Step2. Remove OpenJDK

The following command will remove all java packages. Note that the output has been omitted for brevity

# yum -y remove java*

The java -version command should no longer display the currently installed java version.

# java -version
-bash: /usr/bin/java: No such file or directory

Step 3. Download Oracle JDK

Note that at on the publish date of this article CaféX software has been verified with Java 8 which can be obtained from the Oracle website Note that the 64bit linux version is required - jdk-8u131-linux-x64.*. Note that this article will install using the rpm. The rpm can also be downloaded using wget as follows:

#  wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"

This will download the rpm into the current folder. 

Step 4. Install the Oracle JDK

# rpm -ivh jdk-8u151-linux-x64.rpm

This will install the update 131 of java 8:

# java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Note that java will be installed into /usr/java and establish softlinks as follows:

# ll /usr/java
total 4
lrwxrwxrwx. 1 root root 16 Jun 17 18:48 default -> /usr/java/latest
drwxr-xr-x. 8 root root 4096 Jun 17 18:48 jdk1.8.0_131
lrwxrwxrwx. 1 root root 21 Jun 17 18:48 latest -> /usr/java/jdk1.8.0_151

Note that when installing CafeX software the path to the installed version must be specified. CafeX recommends using the /usr/java/latest softlink which will make updating the java version seamless.



Why OracleJDK over OpenJDK?

The CaféX Fusion Application Server has class dependencies that are only satisfied by the Oracle Java stack. Due to this we only develop and test our software suite against Oracle's JDK and JRE, allowing us to guarantee the behaviour of both our software, and the environment it is installed in.

Therefore, any other Java implementation is not supported.

Is OracleJRE supported?

We support both Oracle JDK and Oracle JRE environments. We support versions 1.7 and 1.8 of both.


Comments are disabled on these articles if you require help contact


Have more questions? Submit a request