Wednesday, October 8, 2008

Installing Java on Ubuntu Linux

It used to be a real pain to install Java on most versions of Linux, but now that Sun has modified the license, there are some easier ways to install Java.

On Debian/Ubuntu Linux for example all you need to do is make sure that your apt-get is pointed at the right place. In your /etc/apt/sources.list add in the following (and make sure you are okay with adding in stuff that is not in the default environment).

deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse

After this have apt updates its repository

sudo apt-get update

And finally, just tell it to install java :)

sudo apt-get install sun-java5-jdk


After this the rest of the process will display a dialog that will require you to accept the license agreement. When you do, the rest of the setup will happen on its own.

When you're on the command prompt type

javac -version

or

java -version


You should be good to go! Finally we have an easy way to install Java on the various Linux variants without having to fight with fakeroot and the other foolishness. Took Sun a criminally long time to do this, but I certainly thank them for it.

Krish.

No comments: