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已经正常工作了