To install OpenJDK 8 JRE using yum, run this command:
.rpmpackage. Substitute the copied download link in place of the highlighted part of the
javacommand). Additionally, some applications require certain environment variables to be set to locate which installation of Java to use. This section will show you how to do this.
JRE_HOMEenvironment variables to determine which
javaexecutable to use.
For example, if you installed Java to
java executable is located at
/usr/java/jdk1.8.0_161/jre/bin/java), you could set your
JAVA_HOME environment variable in a bash shell or script like so: export JAVA_HOME=/usr/java/jdk1.8.0_161/jre
JAVA_HOMEto be set for every user on the system by default, add the previous line to the
/etc/environmentfile. An easy way to append it to the file is to run this command: