我正在尝试将Java SDK 8工具(从debian backports仓库安装)设置为默认工具。
# update-java-alternatives --list
java-1.7.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.7.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1069 /usr/lib/jvm/java-1.8.0-openjdk-amd64
# update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
嗡嗡声,除了该错误(根据/ubuntu/141791/is-there-a-way-to-update-all-java-related-,我认为这只是警告)替代方案,如果没有,我不知道如何解决这个问题,因为没有IcedTea的插件用于jdk8,我可以看到),这应该做的伎俩,对不对?
但是许多Java工具仍然指向Java 7:
# update-alternatives --get-selections | grep java
appletviewer manual /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer
extcheck auto /usr/lib/jvm/java-7-openjdk-amd64/bin/extcheck
idlj auto /usr/lib/jvm/java-7-openjdk-amd64/bin/idlj
jar auto /usr/lib/jvm/java-7-openjdk-amd64/bin/jar
jarsigner auto /usr/lib/jvm/java-7-openjdk-amd64/bin/jarsigner
java manual /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
javac auto /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
javadoc auto /usr/lib/jvm/java-7-openjdk-amd64/bin/javadoc
...
是什么赋予了?破碎?
编辑:
解决此问题的方法:
for i in `update-alternatives --get-selections | grep java | awk '{print $1}'`; do update-alternatives --config $i; done
这将手动提示您输入每个工具。大约需要一分钟。不过,我想知道是否有更好的方法。