Created
October 27, 2014 13:31
-
-
Save aaalaniz/49010cde36435a203998 to your computer and use it in GitHub Desktop.
Install Java 6
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
WORKING_DIR=`pwd` | |
# Download the jdk 1.6 | |
wget http://ghaffarian.net/downloads/Java/JDK/jdk-6u45-linux-x64.bin | |
# Install the jdk | |
sudo mkdir /usr/lib/jvm | |
cd /usr/lib/jvm && sudo sh $WORKING_DIR/jdk-6u45-linux-x64.bin -noregister | |
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 50000 | |
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 50000 | |
sudo update-alternatives --config javac | |
sudo update-alternatives --config java | |
# Set your JAVA_HOME | |
JAVA_HOME=`readlink -f $(which java)` | |
JAVA_HOME=`echo ${JAVA_HOME%/bin/java}` | |
echo "export JAVA_HOME=$JAVA_HOME" >> ~/.bashrc | |
source ~/.bashrc | |
# Navigate back and remove jdk bin | |
cd $WORKING_DIR | |
rm $WORKING_DIR/jdk-6u45-linux-x64.bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment