Java5:

早在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 http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
  2.安装java5,apt-get install sun-java5-jdk.
  4.更改默认jdk的方法如下:
update-alternatives --config java
显示如下,然后键入
java-1.5.0-sun的编号:
有 2 个选项可用于替换项 java (提供 /usr/bin/java)。

 

Java6:

 

ubuntu 10.04

Sun Java moved to the Partner repository

For Ubuntu 10.04 LTS, the sun-java6 packages have been dropped from the Multiverse section of the Ubuntu archive. It is recommended that you use openjdk-6 instead.

If you can not switch from the proprietary Sun JDK/JRE to OpenJDK, you can install sun-java6 packages from the Canonical Partner Repository. You can configure your system to use this repository via command-line:

add-apt-repository "deb http://archive.canonical.com/ lucid partner"

---------------
于是:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

 

 

相关文章:

  • 2021-06-22
  • 2021-05-22
  • 2021-10-02
  • 2021-09-29
  • 2021-04-27
  • 2021-12-06
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2021-09-17
  • 2021-05-11
  • 2021-05-16
  • 2022-12-23
相关资源
相似解决方案