1、Oracle JDK11安装方法
1)Ubuntu或Linux Mint上的安装方法
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java11-installer
2)Debian(64位)上的安装方法
su -
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
apt-get update
apt-get install oracle-java11-installer
exit
3)要使Oracle Java(JDK) 11默认,还要安装oracle-java11-set-default
sudo apt install oracle-java11-set-default
4)如果不想作为默认,则可以删除oracle-java11-set-default
sudo apt remove oracle-java11-set-default
5)自动接受Oracle Java 11 lincense(用于自动安装)
echo oracle-java11-installer shared/accepted-oracle-license-v1-2 select true | sudo /usr/bin/debconf-set-selections
如果上述命令不能正确生效,则可以用下面命令
echo oracle-java11-installer shared/accepted-oracle-licence-v1-2 boolean true | sudo /usr/bin/debconf-set-selections
2、Open JDK11安装
Ubuntu或Linux Mint上的安装方法
sudo add-apt-repository ppa:openjdk-r/ppa \
&& sudo apt-get update -q \
&& sudo apt install -y openjdk-11-jdk