Wednesday, 6 February 2013

How to Install Oracle JDK 7 on Ubuntu 12.10 Linux


To install Oracle JDK 7.0 on Ubuntu linux machine, follow the steps mentioned below:

99designs.com


1. Download Oracle JDK setup from here.

2. Once the download is complete, uncompress the file using following command:
 tar -xvf <File downloaded in step 1>
3. JDK 7 package is extracted into ./jdk1.7.0_02 directory. - Now move the JDK 7 directory to /usr/lib
sudo mv ./jdk1.7.0_02 /usr/lib/jvm/jdk1.7.0 
4. Now Run following commands in the Terminal one by one.
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 
5. Once above three commands has been executed then run following command.
 sudo update-alternatives --config java 
You will see output similar one below - choose the number of jdk1.7.0 - for example 2 in this list:
There are 2 choices for the alternative java (providing /usr/bin/java). 
 Selection      Path                                                              Priority       Status
-----------------------------------------------------------------------------------------------------------------------------  0           /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java     1071          auto mode  1           /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java      1071          manual mode *2           /usr/lib/jvm/jdk1.7.0/bin/java    1        manual mode
6.Repeat the step 5 for below commands
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
 Now, JDK 7 has been successfully installed on your Ubuntu 12.10.


You may also like to read..

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete