Download Red Hat build of OpenJDK

The Red Hat build of OpenJDK is an open source implementation of the Java Platform, Standard Edition (Java SE).

Red Hat Enterprise Linux (RHEL)

Using Yum Installer:

$ sudo yum install java-17-openjdk
$ java -version

openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.2+8-LTS, mixed mode, sharing)

Using Tar.xz File:

Download the file Here

$ mkdir ~/jdks

$ cd ~/jdks

$ tar -xf java-17-openjdk- -C ~/jdks

$ ln -s ~/jdks/java-17-openjdk- ~/jdks/java-17

$ export JAVA_HOME=~/jdks/java-17