1.下载jdk tar
2.解压到/usr/lib/jvm/jdk1.8
3.设置环境变量
vi ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/jdk1.8export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
4.安装验证
java -version