Last active
April 19, 2018 14:42
-
-
Save j-mprabhakaran/a8637cfbd9c7b2e77423398be6acf3d5 to your computer and use it in GitHub Desktop.
Java8-Installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Java 8u172 | |
##################### | |
cd /opt/ | |
sudo wget -c -O "jdk-8u172-linux-x64.tar.gz" --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz" | |
sudo tar xzf jdk-8u172-linux-x64.tar.gz | |
cd /opt/jdk1.8.0_172/ | |
sudo alternatives --install /usr/bin/java java /opt/jdk1.8.0_172/bin/java 2 | |
sudo alternatives --config java | |
sudo alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_172/bin/jar 2 | |
sudo alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_172/bin/javac 2 | |
sudo alternatives --set jar /opt/jdk1.8.0_172/bin/jar | |
sudo alternatives --set javac /opt/jdk1.8.0_172/bin/javac | |
java -version | |
sudo su | |
echo "export JAVA_HOME=/opt/jdk1.8.0_172" > /etc/profile.d/jdk.sh | |
echo "export JRE_HOME=/opt/jdk1.8.0_172/jre" > /etc/profile.d/jdk.sh | |
echo "export PATH=$PATH:/opt/jdk1.8.0_1721/bin:/opt/jdk1.8.0_172/jre/bin" > /etc/profile.d/jdk.sh | |
rm -f /opt/jdk-8u172-linux-x64.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment