下载 JDK 17 64-bit,并解压
vi ~/.bashrc
export JAVA_HOME=/usr/local/java/jdk1.8.0_361(jdk路径)
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source ~/.bashrc
配置文件立刻生效
验证安装:
java -version
出现 java
版本就表明安装成功