INSTALLING Oracle Java JDK 7 On Ubuntu 12.04 step by step
Friday, 30. November 2012
INSTALLING JDK 7 ON UBUNTU 12.04
================================
1) Download the JDK 7 from:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html
2) You will download the tar.gz file. Extract it to your preferred location then run this:
— Create a new folder:
sudo mkdir -p /usr/lib/jvm/jdk1.7.0
— Move the content of JDK to your new location
sudo mv <EXTRACTED_FOLDER>/* /usr/lib/jvm/jdk1.7.0/
— Then Run the following lines one at a time
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
All done!!