HOW TO INSTALL SUN-JAVA IN UBUNTU

Tarun Mall         1 comment

Hi friends,

Problem?

Recently I tried to install sun-jdk on ubuntu but then I found that due to some distribution law of Oracle, sun-jdk is removed from ubuntu repositories. The Oracle geeks care enough to provide easy installer .exe's for Windows but for Linux they are providing only binaries.
So I tried to edit .bashrc file and install sun-jdk but the problem with that is it was working for command prompt but other applications like eclipse were not able to find jre. So I found a new way which I am sharing with you here.

So lets start :)

1. First you have to download the jdk binaries from Oracle website: Download
** Its better if you install jdk it contains java+jre.
2. Then you have to extract the jdk folder somewhere, I did it in my home partition: :~/Java/jdk1.7.0_03
3. Now check if there any jdk installed on your machine or not, you can check that by typing.

java -version

4. If it asks you to install open-jdk then no java is installed otherwise it will tell you the version of open-jdk or whatever java is installed on your machine.

Lets consider first that no java installed on your machine.....

Solution:-

1. Then its simple just open the file /etc/environment with sudo privileges and add following to its end.
:/home/tarun/Java/jdk1.7.0_03/bin:/home/tarun/Java/jdk1.7.0_03/jre/bin
** the bold path is location to your jdk and jre bin's

Now lets consider that you have open-jdk installed on your machine and you want to switch to sun-jdk.......

Solution:-


1. For this migration you have to first install a package called 'java-common'
sudo apt-get install java-common
2. After installing the package you have to run:
sudo update-java-alternatives --config java

then if you have more than one java's installed it will give you option of choosing one as default, and you are done :)

Published by Tarun Mall

A blogger by passion.You can find me tucked in my bed and blogging on weekends when not roaming around. Besides blogging, I love music and you can find my songs on my fb page:PraveenUnplugged
.
Follow on Youtube : Videos On Latest Happenings |ThingsToKnow
.
Follow us Talend In Action

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

© 2015 Techie's House. Designed by Bloggertheme9