1.登录https://www.oracle.com/java/technologies/javase-jdk16-downloads.html,
下载jdk-16.0.1_linux-x64_bin.tar.gz(Linux x64 Compressed Archive)
2.将文件拷贝到/usr/local
3.解压 tar -zxvf jdk-16.0.1_linux-x64_bin.tar.gz
4.vi /etc/profile
5.最后加入
export JAVA_HOME=/usr/local/jdk-16.0.1
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/
6.source profile
7.测试是否安装成功 java -version