1.下载
- jdk所有版本
https://www.oracle.com/java/technologies/downloads/archive/
https://www.oracle.com/java/technologies/downloads/#jdk21-windows
2.安装
省略...
3.java配置
shell
vim /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/local/java/jdk1.8.0_311
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
#生效
source /etc/profile.d/jdk.sh
vim /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/local/java/jdk1.8.0_311
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
#生效
source /etc/profile.d/jdk.sh