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已经正常工作了
本文详细介绍了在Ubuntu系统中安装Sun Java 5 JDK的具体步骤,包括编辑sources.list文件添加相应的软件源,更新软件包列表以及安装Sun Java 5 JDK。此外还提供了安装后如何配置Java环境变量的方法。

313

被折叠的 条评论
为什么被折叠?



