方法一:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get installOracle-java8-installer
方法二:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
openjdk version "1.8.0_01-internal" OpenJDK Runtime Environment (build 1.8.0_01-internal-b04) OpenJDK 64-Bit Server VM (build 25.40-b08,mixed mode)
sudo update-alternatives --config java
sudo update-alternatives --config javac
java -version
原文链接:https://www.f2er.com/ubuntu/354776.html