1:下载安装包
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jdk_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jdk-headless_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jre-headless_8u322-b06-1~deb9u1_amd64.deb
wget http://snapshot.debian.org/archive/debian-security/20220210T090326Z/pool/updates/main/o/openjdk-8/openjdk-8-jre_8u322-b06-1~deb9u1_amd64.deb
2:执行安装
dpkg -i openjdk-8-jre-headless_8u322-b06-1~deb9u1_amd64.deb
dpkg -i openjdk-8-jdk-headless_8u322-b06-1~deb9u1_amd64.deb
apt --fix-broken install libgtk2.0-common libgtk2.0-0
dpkg -i openjdk-8-jre_8u322-b06-1~deb9u1_amd64.deb
dpkg -i openjdk-8-jdk_8u322-b06-1~deb9u1_amd64.deb
3:配置环境变量
/etc/profile
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$PATH:$JRE_HOME/bin:$JAVA_HOME/bin
source /etc/profile使变量生效
4:修改JRE配置
修改/usr/lib/jvm/java-8-openjdk-amd64/jre/lib软连接
将.properties.dpkg-new结尾的文件都改名为.properties后缀