官方提示:10, 12, 13, 14 and 15不可用
About Oracle Java 10, 12, 13, 14 and 15: These versions have reached the end of public updates, therefore they are longer available for download. The Oracle Java 10/12/13/14/15 packages in this PPA no longer worked due to this, so I have removed them. Switch to Oracle Java 11 or OpenJDK 11 instead, which is long term support, or the latest Oracle Java 16.
More info: https://launchpad.net/~linuxuprising/+archive/ubuntu/java
所以现在只能安装11或者16,命令如下
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java16-installer