Ubuntu 9.10以上版本中,Ubuntu就已经去除了对sun-java5-jdk的支持,但是为了进行Android的开发,又必须安装sun-java5-jdk。那么在享受Ubuntu 10.04中,如何来进行sun-java5-jdk的安装呢?
下面是一个方案:
1.编辑/etc/apt/sources.list文件,将安装源更改为Ubuntu 9.04的安装源为:
deb jaunty main restricted universe multiverse
deb jaunty-security main restricted universe multiverse
deb jaunty-updates main restricted universe multiverse
deb jaunty-proposed main restricted universe multiverse
deb jaunty-backports main restricted universe multiverse
deb-src jaunty main restricted universe multiverse
deb-src jaunty-security main restricted universe multiverse
deb-src jaunty-updates main restricted universe multiverse
deb-src jaunty-proposed main restricted universe multiverse
2. sudo apt-get install sun-java5-jdk
3. 接下来的工作是,配置JRE环境:
在shell执行:
sudo update-alternatives --config java
通常会给出两个或两个以上选择的路径
选择:/usr/lib/jvm/java-1.5.0-sun/jre/bin/java作为你的JRE
4.建议安装安装浏览器Java插件(不是必要的):
在shell中执行:
sudo apt-get install sun-java5-plugin
以上