OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)Īdd the following line to ~/. OpenJDK Runtime Environment 18.9 (build 11.0.2+9) Press to keep the current choice, or type selection number: There are 2 choices for the alternative java_home (providing /opt/java/current). Log Out or restart Ubuntu (this will reload /etc/profile.d/environment.sh) UsageĬhoose the version you want to use ~$ sudo update-alternatives -config java_home ~$ sudo update-alternatives -install /opt/java/current java_home /opt/java/jdk1.8.0_201 200ĭeclare JAVA_HOME (In this case, I use a global initialization script for this) ~$ sudo sh -c 'echo export JAVA_HOME=\"/opt/java/current\" > environment.sh' 15 2018 jdk1.8.0_201/Ĭonfigure alternatives ~$ sudo update-alternatives -install /opt/java/current java_home /opt/java/jdk-11.0.2/ 100 ĭrwxr-xr-x 8 stephanecodes stephanecodes 4096 jan. Install every java version in /opt/java/, for example ~$ ll /opt/java/ĭrwxr-xr-x 6 root root 4096 jan. I use update-alternatives this way, using a java_home alternative instead : Installation Most of the time, when I change my java version, I also want to use the same javac version. Is there a way to confirm that what I have done is correct? So which number should I select to have sun-java as the default runtime?Īlso, what exactly do th auto and manual modes mean? If I select 3 above and run the update-alternative command I receive the same output as above, again nothing seems to have changed except that the * is now in front of the 3, though it still reads manual mode. Press enter to keep the current choice, or type selection number: * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto modeĢ /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual modeģ /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode Yet when I run this command I get: There are 3 choices for the alternative java (providing /usr/bin/java). Then am told that I should use the command sudo update-alternatives -config java to make sure that a particular java (sun-java) is the default runtime. I have been instructed to install sun-java jdk 1st. I am installing Apache Solr on Linux Debian (Squeeze).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |