Then make jdk-11.sh executable, and run sudo. Update-alternatives -remove $c /usr/lib/jvm/$install_dir/bin/$c Update-alternatives -install /usr/bin/$c $c /usr/lib/jvm/$install_dir/bin/$c 1102 We will use openjdk-11+28-amd64 here Create a shell script to udpate alternatives automaticallyĮcho " -i install alternatives for jdk-11"Įcho " -r remove alternatives for jdk-11"Ĭmd=(java jexec jjs keytool pack200 rmid rmiregistry unpack200 jaotc jarsigner jar javac javadoc javap jcmd jdb jdeprscan jdeps jhsdb jimage jinfo jlink jmap jmod jps jrunscript jshell jstack jstatd jstat rmic serialver jconsole) how to do it Install jdk-11įirst install jdk-11 inside a directory in /usr/lib/jvm. Your first command was wrong, I think it should have been: sudo update-alternatives /usr/bin/java java /opt/jdk-11/bin/java 1102Īnd the same for all the others executables of the jdk. What does the warning mean, and why is it in fact showing both auto and manual mode entries? And why is my jdk11 not in there? There are 2 choices for the alternative java (providing /usr/bin/java).Ġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 auto modeġ /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1101 manual modeĢ /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode Instead I get a warning and the already existing choices: update-alternatives: warning: /etc/alternatives/java has been changed (manually or by a script) switching to manual updates only However, when I do $ sudo update-alternatives -config java Which returns: update-alternatives: using /opt/jdk-11/bin/javac to provide /etc/alternatives/java (OpenJDK-11) in auto mode To try out the new features of jdk11 I installed it into /opt/ and want to use it using update-alternatives, like so: sudo update-alternatives -install /etc/alternatives/java OpenJDK-11 /opt/jdk-11/bin/java 1102
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |