下载jdk10
链接: https://pan.baidu.com/s/1AMKdxZA290SW1SfqZbuEQg 密码: da6u
解压后移动
tar xf jdk-10.0.2_linux-x64_bin.tar.gz mv jdk-10.0.2 /usr/local/jdk10
配置环境变量
export JAVA_HOME=/usr/local/jdk10 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
测试jdk是否安装成功
java -version