[HOW TO] Install Oracle Java SDK in Ubuntu 13.04

Oracle Java is required for most of the software and application to install and run. Installing Java SDK in Windows is easier and simple. One need to download the jdk or jre from the official site of Oracle and install.

But Installing the Java SDK in Ubuntu is a bit different than Windows. There are two ways of installing Java in Ubuntu 13.04, 12.04 LTS, 12.10, and others.

First Method:

Open the Terminal (Clt+Alt+T) and run the command given below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
You are done and then check the version of Java executing in terminal:
java -version
Second Method:

First download the jdk from the official site of Oracle Java from this link: Download JDK

Both 32 bit and 64 bit jdk files are available. Download the .tar.gz file uncompress the file:
tar -xvf jdk-7u21-linux-i586.tar.gz (32bit)
tar -xvf jdk-7u21-linux-x64.tar.gz (64bit) 
Then move the uncompressed file to /usr/bin folder by executing the command given below:
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.7.0_21 /usr/lib/jvm/jdk1.7.0 
After moving the file open the terminal and execute:
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 
Now change the permission and run
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
sudo update-alternatives –config java
Its all done and check the java version
java -version  
[HOW TO] Install Oracle Java SDK in Ubuntu 13.04 [HOW TO] Install Oracle Java SDK in Ubuntu 13.04 Reviewed by RefreshIt on 7:59:00 PM Rating: 5

No comments:

Powered by Blogger.