Download the JDK
Jk-7u79-linux-x64.rpm = jK-7U79-linux-x64.rpm = jK-7U79-linux-x64.
The RPM installation:
RPM -ivh JDK installation package directory/jdK-7u79-linux-x64.rpm
Explain:
-i, – install install Package (s) -v, – verbose provides more detailed output of the software package during the installation. -h, hash displays the installation progress print hash marks as package installs (good with -v)
Configuring environment Variables
vim /etc/profile
Add at the end
Save the file and run the following command for the configuration file to take effect.
Export JAVA_HOME = / usr/Java/jdk1.7.0 _79
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
Disable the configuration file: source /etc/profile
Here’s a final test:
Java -version Java version “1.7.0_79” Java(TM) SE Runtime Environment (build 1.7.0_79-B15) Java HotSpot(TM) 64-bit Server VM (build 24.79-B02, Mixed mode)