March 22, 2010

Installing java on UBUNTU

Recently wanted to install YUI compresssor which need java runtime for execution.


To install java we need to run following command on terminal -

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

 If during installation you get error like "Err http://us.archive.ubuntu.com hardy-updates/multiverse sun-java6-bin 6-14-0ubuntu1.8.04   404 Not Found [IP: 91.189.88.46 80]"

You are required to Enable universe and multiverse repositories which can be done from command line as below -
Open a terminal and go to /etc/apt/ . backup sources.list file .Then edit it using the following command
vi /etc/apt/sources.list
Add following lines
## MAIN REPOSITORIES
deb http://gb.archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
## MAJOR BUG FIX UPDATES produced after the final release
deb http://gb.archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
## UBUNTU SECURITY UPDATES
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
If you wish to enable the backports and proposed repositories as well (recommended), then add these lines as well
## BACKPORTS REPOSITORY
deb http://gb.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
## PROPOSED REPOSITORY
deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse

Once saved execute

sudo apt-get update

If it runs without error you shall be able to install JRE using this command with no problem -

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

No comments:

Post a Comment