文章借鉴至 https://blog.csdn.net/allway2/article/details/108423652
apt install -y wget gnupg software-properties-common
添加AdoptOpenJDK存储库
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
安装Java 8
apt update -y && apt install adoptopenjdk-8-hotspot -y
输入java -version
,如果显示如下内容则为安装成功:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)
评论 (0)