Last active
August 29, 2015 14:22
-
-
Save petergdoyle/c60903823a21847ee5c6 to your computer and use it in GitHub Desktop.
install an oracle 7 jdk into a fedora or centos based 64 bit OS
This file contains 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
#!/bin/sh | |
# | |
# Centos Fedora Equip | |
# Java 7 64-bit Equip | |
# Licence: MIT | |
# to run: wget --no-check-certificate https://gist.githubusercontent.com/petergdoyle/c60903823a21847ee5c6/raw/4ceaeb79075964ea0f668e2a0d5b4b89bd049804/equip_centos7_java7_64.sh && bash equip_centos7_java7_64.sh | |
if [ -d "/usr/java/jdk7/" ]; then | |
echo "There's already an installation of Java JDK in /usr/java/jdk7/" | |
rm -f equip_centos7_java7_64.sh | |
echo "Skipping..." | |
exit 0 | |
fi | |
sudo yum install curl -y | |
curl -L --cookie "oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u65-b17/jdk-7u65-linux-x64.tar.gz -o jdk-7-linux-x64.tar.gz | |
tar -xvf jdk-7-linux-x64.tar.gz | |
sudo mkdir -p /usr/java/ | |
sudo mv ./jdk1.7.0_65 /usr/java/ | |
sudo ln -s /usr/java/jdk1.7.0_65 /usr/java/jdk7 | |
sudo ln -s /usr/java/jdk7 /usr/java/default | |
sudo alternatives --install "/usr/bin/java" "java" "/usr/java/default/bin/java" 99999 | |
sudo alternatives --install "/usr/bin/javac" "javac" "/usr/java/default/bin/javac" 99999 | |
sudo alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/default/bin/javaws" 99999 | |
sudo chown -R root:root /usr/java | |
rm jdk-7-linux-x64.tar.gz | |
rm -f equip_centos7_java7_64.sh | |
java -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment