在较高版本的Ubuntu上安装 sun-java5-jdk

1- Open /etc/apt/sources.list with a text editor like gedit:sudo gedit /etc/apt/sources.list

2- Add the following lines to the end of the file then save it and close:

## For sun-java5-jdk
deb http://ir.archive.ubuntu.com/ubuntu jaunty-updates main multiverse

3- Update the packages lists and install sun-java5-jdk:

sudo apt-get update
sudo apt-get install

安装后的基本设置:

sudo update-alternatives --config java

sudo update-java-alternatives -s java-1.5.0-sun

这时候再用java -version就能看到java 1.5已经正常工作了

posted @ 2011-12-23 17:57  Jezze  阅读(283)  评论(0编辑  收藏  举报