Sunday, 3 February 2013

Java Installation on Ubuntu 12.04

1.Installation OpenJDK
Download and Install OpenJDK and Oracle JDK on ubuntu 12.04
sudo apt-get install openjdk-7-jre
If your system has more than one version of Java, configure which one your system
uses be entering the following command in a terminal window
sudo update-alternatives --config java
Select the option corresponding to desired java version 2.
2.Installation of oracle JDK
  • Download Oracle JDK
Go to download site
and select jdk-7u4-linux-x64.tar.gz for download.
  • Extract and Install
tar -xvf jdk-7u2-linux-x64.tar.gz (64bit)
JDK 7 package is extracted into ./jdk1.7.0_02 directory
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/softwares-linux/jdk1.7.0_04/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/softwares-linux/jdk1.7.0_04/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/softwares-linux/jdk1.7.0_04/bin/javaws" 1
  • Configure Default Java Configuration
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
Check the version of you new JDK 7 installation
Reference :
3.NetBeans IDE installation
Go  to Netbeans IDE download page
select the suitable installation .
This will download file
Execute the script
sudo sh ./netbeans-6.5-ml-java-linux.shcript
After the installation has completed set up soft links to the library and provide suitable permission
ln -s /opt/softwares-linux/netbeans-7.1.2/bin/netbeans /usr/local/bin/netbeans

Reference :

before launching change the java reference to openjdk