?를 사용하여 모든 Java 관련 대안을 신속하게 전환하는 방법이 update-alternatives
있습니까?
예를 들어 Java를 7로 전환 sudo update-alternatives --config java
하려면 Java 7 OpenJdk를 실행 하고 선택합니다. 그러나 내가 달리면 update-alternatives --get-selections | grep java
다음과 같은 것을 얻습니다.
appletviewer auto /usr/lib/jvm/java-6-openjdk-amd64/bin/appletviewer
extcheck auto /usr/lib/jvm/java-6-openjdk-amd64/bin/extcheck
idlj auto /usr/lib/jvm/java-6-openjdk-amd64/bin/idlj
itweb-settings auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/itweb-settings
jar auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jar
jarsigner auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jarsigner
java manual /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
javac auto /usr/lib/jvm/java-6-openjdk-amd64/bin/javac
javadoc auto /usr/lib/jvm/java-6-openjdk-amd64/bin/javadoc
javah auto /usr/lib/jvm/java-6-openjdk-amd64/bin/javah
javap auto /usr/lib/jvm/java-6-openjdk-amd64/bin/javap
javaws auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws
jconsole auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jconsole
jdb auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jdb
jexec auto /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jexec
jhat auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jhat
jinfo auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jinfo
jmap auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jmap
jps auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jps
jrunscript auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jrunscript
jsadebugd auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jsadebugd
jstack auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jstack
jstat auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jstat
jstatd auto /usr/lib/jvm/java-6-openjdk-amd64/bin/jstatd
keytool auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/keytool
native2ascii auto /usr/lib/jvm/java-6-openjdk-amd64/bin/native2ascii
orbd auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/orbd
pack200 auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/pack200
policytool auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/policytool
rmic auto /usr/lib/jvm/java-6-openjdk-amd64/bin/rmic
rmid auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/rmid
rmiregistry auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/rmiregistry
schemagen auto /usr/lib/jvm/java-6-openjdk-amd64/bin/schemagen
serialver auto /usr/lib/jvm/java-6-openjdk-amd64/bin/serialver
servertool auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/servertool
tnameserv auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/tnameserv
unpack200 auto /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/unpack200
wsgen auto /usr/lib/jvm/java-6-openjdk-amd64/bin/wsgen
wsimport auto /usr/lib/jvm/java-6-openjdk-amd64/bin/wsimport
xjc auto /usr/lib/jvm/java-6-openjdk-amd64/bin/xjc
보시다시피, Java 대안은 7로 전환되었지만 OpenJDK 6 기반의 다른 모든 대안은 전환되지 않았습니다. 물론 각 스위치를 수동으로 전환하거나 스크립트를 작성하여이 작업을 수행 할 수있는 더 좋은 방법이 있다고 가정합니다.
update-java-alternatives
플러그인 설정에서 오류가 발생하더라도 다른 모든 Java 대안을 변경합니다.