Ubuntu10.10安装sun-java5-jdk

 http://source.android.com/source/download.html 中要求ubuntu配置android开发环境时需要安装sun-java5-jdk,但ubuntu10.10默认源中已无此软件包,因此需要使用以下方法:
1.在源配置中添加ubuntu9.04源
$ sudo gedit /etc/apt/sources.list                                   #root权限使用gedit编辑sources.list内容
文档末尾复制粘帖以下内容,然后保存并关闭文件:
## 9.04 Sources for sun-java5-jdk
deb http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse
deb-src http://run.hit.edu.cn/ubuntu/ jaunty main restricted universe multiverse
deb http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://run.hit.edu.cn/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://run.hit.edu.cn/ubuntu/ jaunty-backports main restricted universe multiverse
deb http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://run.hit.edu.cn/ubuntu/ jaunty-security main restricted universe multiverse

2.更新源内容并安装sun-java5-jdk
$ sudo apt-get update                                   #更新源及可用软件包内容
$ sudo apt-get install sun-java5-jdk               #安装sun-java5-jdk,过程中需要阅读许可并键入“y”同意
$ java -version                                               #查看java是否安装
会显示类似下面的内容:
java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)

3.建议把第一步中添加的ubuntu9.04源删除,并重新更新源

你可能感兴趣的:(ubuntu)