Skip to content

Instantly share code, notes, and snippets.

@yonglai
Created October 7, 2017 22:30
Show Gist options
  • Save yonglai/8aeeadd8823f7665f965de714a26498f to your computer and use it in GitHub Desktop.
Save yonglai/8aeeadd8823f7665f965de714a26498f to your computer and use it in GitHub Desktop.
#! /bin/bash
echo install jdk1.8
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
yum localinstall jdk-8u144-linux-x64.rpm -y
touch /etc/profile.d/java.sh
export JAVA_HOME='/usr/java/jdk1.8.0_144'
cat <<EOT > /etc/profile.d/java.sh
export JAVA_HOME="$JAVA_HOME"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"
EOT
rm jdk-8u144-linux-x64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment