Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Install JDK on RHEL 6.6

Martin O'Connor edited this page Aug 8, 2016 · 7 revisions

Install version 1.8 of the JDK:

yum install java-1.8.0-openjdk-devel

Configure Java version with the interactive tool alternatives. Choose 1.8 for each of the below commands:

alternatives --config java
alternatives --config javac
alternatives --config jre_openjdk
alternatives --config java_sdk_openjdk

Verify Java version:

java -version

Set JAVA_HOME by adding new global profile script:

vi /etc/profile.d/java.sh

Paste the following content into the file:

export JAVA_HOME=/usr/lib/jvm/java

Apply the modification for the current shell session:

source /etc/profile.d/java.sh

Check if JAVA_HOME is set:

env | grep JAVA_HOME

The following are a few rpm examples that can be used to check installed packages:

rpm -qa | grep java
rpm -ql java-1.8.0-openjdk
rpm -qf /path/to/file
Clone this wiki locally