Installing OpenJDK 8 on RHEL-based Systems

Steps for installing OpenJDK 8 on RHEL-based Systems.

Java 9 is not supported.

In a terminal:
  1. Install the OpenJDK 8:
    su -c "yum install java-1.8.0-openjdk"
  2. If you have more than one Java version installed on your system use the following command to switch versions:
    sudo alternatives --config java
  3. Make sure your system is using the correct JDK:
    java -version
    openjdk version "1.8.0_171"
    OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11)