安装java8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
查看java是否安装成功
java -version
该版本java设为默认
sudo apt-get install oracle-java8-set-default
安装java11
sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java11-installer
查看java是否安装成功
java -version
该版本java设为默认
sudo apt-get install oracle-java11-set-default
原文地址:https://www.cnblogs.com/wintersoft/p/9923829.html
时间: 2024-09-29 10:52:22