1.下载java8
可以在如下页面找到对应的软件包https://docs.aws.amazon.com/zh_cn/corretto/latest/corretto-8-ug/downloads-list.html
wget https://d3pxv6yz143wms.cloudfront.net/8.222.10.1/java-1.8.0-amazon-corretto-jdk_8.222.10-1_amd64.deb
2.安装java-common软件包
apt-get update && apt-get install java-common
3.使用dpkg命令直接安装.deb文件
dpkg --install java-1.8.0-amazon-corretto-jdk_8.222.10-1_amd64.deb
4.查看版本
# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment Corretto-8.222.10.1 (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM Corretto-8.222.10.1 (build 25.222-b10, mixed mode)