怎样让自己装的jdk出现在jvm选项里面?

为当前最终发行版之前的所有版本提供支持
回复
zouzhile
帖子: 36
注册时间: 2005-11-16 9:40
送出感谢: 0
接收感谢: 0

怎样让自己装的jdk出现在jvm选项里面?

#1

帖子 zouzhile » 2006-09-25 18:02

大家好!
通过update-alternatives --config java命令我们可以修改所选用的jvm的版本。
今天我下载了一个jdk1.6.0的.bin格式的安装文件, 运行后他就是在当前目录下创建了一个jdk的根目录。我刚开始以为需要把这个目录拷贝到/usr/lib/jvm下面就可以在jvm选项里面出现这个选项, 可是不是这样的。
通过ls -a /usr/lib/jvm命令我发现对于现有的能够在jvm选项里面出现的jvm版本都有一个.jinfo的文件,比如对于jdk1.5.0的就有下面这个相应内容的.jinfo文件:

代码: 全选

name=java-1.5.0-sun-1.5.0.06
alias=java-1.5.0-sun
priority=53
section=non-free

jre ControlPanel /usr/lib/jvm/java-1.5.0-sun/jre/bin/ControlPanel
jre java /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
jre java_vm /usr/lib/jvm/java-1.5.0-sun/jre/bin/java_vm
jre javaws /usr/lib/jvm/java-1.5.0-sun/jre/bin/javaws
jre keytool /usr/lib/jvm/java-1.5.0-sun/jre/bin/keytool
jre pack200 /usr/lib/jvm/java-1.5.0-sun/jre/bin/pack200
jre policytool /usr/lib/jvm/java-1.5.0-sun/jre/bin/policytool
jre rmid /usr/lib/jvm/java-1.5.0-sun/jre/bin/rmid
jre rmiregistry /usr/lib/jvm/java-1.5.0-sun/jre/bin/rmiregistry
jre unpack200 /usr/lib/jvm/java-1.5.0-sun/jre/bin/unpack200
jdk HtmlConverter /usr/lib/jvm/java-1.5.0-sun/bin/HtmlConverter
jdk appletviewer /usr/lib/jvm/java-1.5.0-sun/bin/appletviewer
jdk apt /usr/lib/jvm/java-1.5.0-sun/bin/apt
jdk extcheck /usr/lib/jvm/java-1.5.0-sun/bin/extcheck
jdk idlj /usr/lib/jvm/java-1.5.0-sun/bin/idlj
jdk jar /usr/lib/jvm/java-1.5.0-sun/bin/jar
jdk jarsigner /usr/lib/jvm/java-1.5.0-sun/bin/jarsigner
jdk java-rmi.cgi /usr/lib/jvm/java-1.5.0-sun/bin/java-rmi.cgi
jdk javac /usr/lib/jvm/java-1.5.0-sun/bin/javac
jdk javadoc /usr/lib/jvm/java-1.5.0-sun/bin/javadoc
jdk javah /usr/lib/jvm/java-1.5.0-sun/bin/javah
jdk javap /usr/lib/jvm/java-1.5.0-sun/bin/javap
jdk jconsole /usr/lib/jvm/java-1.5.0-sun/bin/jconsole
jdk jdb /usr/lib/jvm/java-1.5.0-sun/bin/jdb
jdk jinfo /usr/lib/jvm/java-1.5.0-sun/bin/jinfo
jdk jmap /usr/lib/jvm/java-1.5.0-sun/bin/jmap
jdk jps /usr/lib/jvm/java-1.5.0-sun/bin/jps
jdk jsadebugd /usr/lib/jvm/java-1.5.0-sun/bin/jsadebugd
jdk jstack /usr/lib/jvm/java-1.5.0-sun/bin/jstack
jdk jstat /usr/lib/jvm/java-1.5.0-sun/bin/jstat
jdk jstatd /usr/lib/jvm/java-1.5.0-sun/bin/jstatd
jdk native2ascii /usr/lib/jvm/java-1.5.0-sun/bin/native2ascii
jdk rmic /usr/lib/jvm/java-1.5.0-sun/bin/rmic
jdk serialver /usr/lib/jvm/java-1.5.0-sun/bin/serialver
plugin mozilla-javaplugin.so /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
plugin firefox-javaplugin.so /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
plugin mozilla-snapshot-javaplugin.so /usr/lib/jvm/java-1.5.0-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
我把里面的路径都替换成了我的jdk1.6.0的路径,而且“name=java-1.5.0-sun-1.5.0.06”里面也改了,可是这个jdk1.6.0就是不能出现在jvm选项里面。不知道怎样才能让让我的jdk1.6.0出现在jvm选项里进而选择它成为我默认的jvm呢?
谢谢大家! :)
zouzhile
帖子: 36
注册时间: 2005-11-16 9:40
送出感谢: 0
接收感谢: 0

#2

帖子 zouzhile » 2006-09-26 13:49

版主是否能够帮着解决一下呢?
zigzed
帖子: 267
注册时间: 2006-02-27 10:32
送出感谢: 0
接收感谢: 0

#3

帖子 zigzed » 2006-12-20 16:23

代码: 全选

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-1.6.0-sun/bin/java" 1
sudo update-alternatives --config java
回复

回到 “老旧版本支持”