Fresh Brew

10.05.2007

How To Install Java 6 on Ubuntu

Misunderstandings of how to install Sun Java seem rampant on the Ubuntu forums, and trying to clear the fog is this post at the Open Source Software Geeks. As per the post, installing Java on Ubuntu is a "breeze". This is how:

Before you begin, you need to ensure that your repositories are up to date by issuing the following:

sudo apt-get update


If you are developing Java applications, you will require Java Development Kit (JDK), on the other hand if you just require Java to run Java applications, then you need just Java Runtime Environment (JRE). For the former, the command is as follows:

sudo apt-get install sun-java6-jdk sun-java6-plugin

For JRE:

sudo apt-get install sun-java6-jre sun-java6-plugin


Once either one is done, run the sudo update-java-alternatives -s java-6-sun command and finally add the line “/usr/lib/jvm/java-6-sun” to the top of the /etc/jvm file (gksudo gedit /etc/jvm). Save and exit. To test your Java(TM) setup in the terminal type:-


java -version


If you get an output like below, then you are done!


java version “1.6.0″ Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)



back

top

print

recommend

comments



ubuntu newbie in mn schrieb am 16.04.2008, 07:50 Uhr
Thank you! worked like a charm.



ubuntu newbie in mn schrieb am 16.04.2008, 07:50 Uhr
Thank you! worked like a charm.



lapchinj schrieb am 22.08.2008, 21:44 Uhr
The instructions worked Flawlessly. Beautiful, Awesome.



tc schrieb am 02.11.2008, 17:02 Uhr
Thanks a bunch. Well documented and simple steps.



Are schrieb am 26.02.2009, 04:01 Uhr
thank you,



NEW2LINUx schrieb am 28.03.2009, 14:36 Uhr
Thanks! Worked Perfect!!!