Install Java 8 on CentOS 7



Install Java 8 on CentOS 7

Install Java 8 on CentOS 7

In this video, we will install Java 8 on a CentOS 7 server. These instructions include updating the server, verifying the Java install, setting java’s home environment, as well as setting java’s path. This video is accompanying the article located at https://www.liquidweb.com/kb/install-java-8-on-centos-7/

Author: Justin Palmer

Commands used:

yum -y update

yum install java-1.8.0-openjdk

java -version

update-alternatives –config java

vim .bash_profile
add
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java
to the bottom of the file.
Source .bash_profile
to refresh the file
echo $JAVA_HOME
should output
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java