Java Installation Steps

Manual installation
For manual installation the installation package needs to be downloaded. For this go to the oracle webside for downloading JDK. Accept the license agreement and copy the link of the tar.gz file location (). Then go to temp folder, download and extract the tar file

cd /tmp

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "" tar xzf .tar.gz sudo mv  /opt/jdk

Java with Alternatives
The alternatives command is used for maintained symbolic links. This command used to creates, removes, maintains and displays information about the symbolic links comprising the alternatives system.

"alternatives --install /usr/bin/java java /opt/jdk/bin/java 2 alternatives --config java""Enter to keep the current selection[+], or type selection number:"Also recommended is to setup javac and jar commands path using alternatives."alternatives --install /usr/bin/jar jar /opt/jdk/bin/jar 2 alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 2 alternatives --set jar /opt/jdk/bin/jar alternatives --set javac /opt/jdk/bin/javac"

Java Environment Variables
For the Java based applications need environment variables set up. Set the Java environment variables. "vim ~/.bashrc"Add the below lines at the end of this file export JAVA_HOME=/opt/jdk export JRE_HOME=/opt/jdk/jre export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

Check Java
"java -version java version '1.8.0_171' Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)" 