centos7安装jdk1.8

1 下载jdk 

https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1542450035_d96827e3a14a29566e52dbdf27c5fe73

 

2 解压 

tar -zxvf jdk-8u191-linux-x64.tar.gz

3 配置环境变量

配置环境 vi  /etc/profile,在最后添加

export JAVA_HOME=/home/java/jdk1.8.0_11
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

 

posted @ 2018-11-17 18:24  冬天不眠  阅读(126)  评论(0编辑  收藏  举报