1.先下载jdk8,下载地址https://www.oracle.com/java/technologies/downloads/ ;本人用的jdk:jdk-8u333-linux-x64.tar.gz
2.上传到服务器中
3.将jdk8复制到/usr/local/下 : cp ./jdk-8u333-linux-x64.tar.gz /usr/local/
4.进入到/usr/local目录,解压文件:tar -zxvf jdk-8u333-linux-x64.tar.gz
5.配置环境变量:vi /etc/profile 在最后添加如下信息:
export JAVA_HOME=/usr/local/jdk1.8.0_333
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$CLASSPATH:$PATH
6.刷新一下配置: source /etc/profile
7.查看安装是否成功: java -version
标签:jdk,tar,export,usr,linux,HOME,安装 From: https://www.cnblogs.com/shuishuowobushihuiyuan/p/17901786.html