Skip to content

Instantly share code, notes, and snippets.

@obar1
Last active November 11, 2016 18:30
Show Gist options
  • Save obar1/c928199a54fd129d92581a7abfc90091 to your computer and use it in GitHub Desktop.
Save obar1/c928199a54fd129d92581a7abfc90091 to your computer and use it in GitHub Desktop.
sudo yum remove java-1.*.0-openjdk-*
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jdk-8u40-linux-x64.rpm"
# latest
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.rpm
### TODO to update
su
rpm -ivh jdk-8u40-linux-x64.rpm
alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_40/bin/java 2
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0_40/bin/javaws 2
alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0_40/bin/javac 2
alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0_40/bin/jar 2
alternatives --install /usr/bin/jps jps /usr/java/jdk1.8.0_40/bin/jps 2
echo "" >> /etc/profile
echo "## Setting JAVA_HOME and PATH for all USERS ##" >> /etc/profile
echo "export JAVA_HOME=/usr/java/jdk1.8.0_40" >> /etc/profile
echo "export PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/profile
source /etc/profile
exit
java -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment