Skip to content

Instantly share code, notes, and snippets.

@bot11
Created April 4, 2015 02:12
Show Gist options
  • Save bot11/f8bab36275c8cf15973c to your computer and use it in GitHub Desktop.
Save bot11/f8bab36275c8cf15973c to your computer and use it in GitHub Desktop.
Install java from source
Download java from this link:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Alternatively , wget as below:
wget --no-check-certificate --no-cookies - --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz
sudo mv jdk-7u51-linux-x64.tar.gz /usr/lib/jvm [create if /usr/lib/jvm not present, can be put in /usr/local also.]
sudo tar zxvf jdk-7u51-linux-x64.tar.gz
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_51/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_51/bin/java 1
sudo update-alternatives --set javac /usr/lib/jvm/jdk1.7.0_51/bin/javac
sudo update-alternatives --set java /usr/lib/jvm/jdk1.7.0_51/bin/java
sudo vim /etc/profile
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
source /etc/profile
Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment