Standard install of Ubuntu 12.04 LTS Desktop installs OpenJDK1.07. I want Oracle JDK 1.7, so I installed it the following way:
1) Download the JDK 7 from:
http://www.oracle.com/technetwork/ja...s-1859576.html2) 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 locationsudo mv <EXTRACTED_FOLDER>/* /usr/lib/jvm/jdk1.7.0/
– Then Run the following lines one at a timesudo 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
This seems to work perfectly. When doing a java -version it gives me the last installed version 1.7.0_45.
But my question is: should I uninstall the OpenJDK1.7 (or leave it on my machine)?
Thanks.
Bookmarks