JVM version manager

前端 未结 6 1886
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 14:06

Is there Ruby Version Manager equivalent for the Java world?

I\'m looking for tool which allow me to easily download and install a new JVMs and switch between them. For

6条回答
  •  一整个雨季
    2021-02-01 14:26

    The trick is to use update-java-alternatives (from the java-common package). The update-alternatives command will not update every one of the symbolic links for various java /bin executables, which is why update-java-alternatives is better.

    So to go for OpenJDK 6 to 7, use update-java-alternatives -l to get a list of Java alternatives and then used sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 to switch the JDK.

    CAVEAT: The command above might throw the following errors,

    update-alternatives: error: no alternatives for mozilla-javaplugin.so.
    update-java-alternatives: plugin alternative does not exist: 
      /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
    

    This is because the openjdk plugin is not installed by default. To fix run sudo apt-get install icedtea-7-plugin and rerun update-java-alternatives.

提交回复
热议问题