Install Java JRE on CentOS7 and set JAVA_HOME

Lets find Java packages for CentOS 7

I am looking for a Java JRE , so I will install it via yum install command:

once its finished installing check the version:

Find if there is any java registered for our $JAVA_HOME:

Find where java is installed, if the above echo command comes back empty:

Now we need to make sure that JAVA_HOME is in the path each time we login or reboot the server, and for that we need to add it to a startup file under profile.d :

The command “echo $JAVA_HOME” ¬†should return the java path now deffinetly:

reboot, and test again to confirm that¬† “echo $JAVA_HOME” is returning the Java install path.


This should be it, at least for now for the majority of apps we going to use.