ubuntu 下 切换多个jdk版本

执行下面的命令即可切换
sudo update-alternatives --config java

命令执行效果如下(依据安装的jdk数量会有不同):

jack@jack-7560:~$ sudo update-alternatives --config java
[sudo] password for jack: 
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-14-openjdk-amd64/bin/java      1411      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-14-openjdk-amd64/bin/java      1411      manual mode
  3            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 
上一篇:ubuntu 19.10 libpng12.so.0 无法安装问题


下一篇:node_exporter 自定义监控