Ubuntu等Linux下命令行安装jdk8的方法

时间:2022-06-14 02:05:18


方法一:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

sudo apt-get install Oracle-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