deb jaunty multiverse#sudo apt-get update
deb jaunty-updates multiverse
#sudo apt-get install sun-java5-jdk
#update-alternatives --config java
#update-alternatives --config javac
显示如下,然后键入java-1.5.0-sun的 编号:
有 2 个选项可用于替换项 java (提供 /usr/bin/java)。
选择 路径 优先级 状态
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 自动模式
1 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java 53 手动模式
2 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 手动模式
Selection Path 優先級 Status
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/bin/javac 1061 auto mode
1 /usr/bin/ecj 143 manual mode
2 /usr/bin/gcj-wrapper-4.4 1044 manual mode
* 3 /usr/lib/jvm/java-1.5.0-sun/bin/javac 53 manual mode
4 /usr/lib/jvm/java-6-openjdk/bin/javac 1061 manual mode
查看当前的java版本:
#java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing
)