How to use the command update-alternatives --config java

后端 未结 8 1718
北恋
北恋 2020-11-28 22:05

I am installing Apache Solr on Linux Debian (Squeeze). I have been instructed to install sun-java jdk 1st. Then am told that I should use the command sudo update-alter

8条回答
  •  悲哀的现实
    2020-11-28 22:42

    update-alternatives is problematic in this case as it forces you to update all the elements depending on the JDK.

    For this specific purpose, the package java-common contains a tool called update-java-alternatives.

    It's straightforward to use it. First list the JDK installs available on your machine:

    root@mylaptop:~# update-java-alternatives -l
    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
    

    And then pick one up:

    root@mylaptop:~# update-java-alternatives -s java-1.7.0-openjdk-amd64
    

提交回复
热议问题