Installing OpenJDK 8 on RHEL-based Systems
Steps for installing OpenJDK 8 on RHEL-based systems.
Note: After installing the JDK, you may need to set
JAVA_HOME to your profile:
- For shell or bash:
export JAVA_HOME=path_to_java_home
- For csh (C shell):
setenv JAVA_HOME=path_to_java_home
These instructions show you how to install OpenJDK.
DataStax has tested OpenJDK at scale.
-
Check which version of the JDK your system is using:
java -version
If the OpenJDK is used, the results should look like:openjdk version "1.8.0_242" OpenJDK Runtime Environment (build 1.8.0_242-b09) OpenJDK 64-Bit Server VM (build 25.242-b09, mixed mode)
If Oracle Java is used, the results should look like:java version "1.8.0_241" Java(TM) SE Runtime Environment (build 1.8.0_241-b07) Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
-
Update the repositories:
sudo update yum
-
Install OpenJDK:
sudo yum install java-1.8.0-openjdk
The latest JDK is installed.
-
Verify the version of the JDK:
java -version
openjdk version "1.8.0_242" OpenJDK Runtime Environment (build 1.8.0_242-b09) OpenJDK 64-Bit Server VM (build 25.242-b09, mixed mode)
-
If the correct version of the JDK is not being used, use the
alternatives command to switch it:
sudo alternatives --config java