centos7 安装jdk
一、官方jdk地址
https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1542448153_19847d36b3040941b0188ee81ea964aa
二、安装wget
yum install wget
三、下载jdk
wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1542448153_19847d36b3040941b0188ee81ea964aa
四、解压到文件夹、配置环境变量
4.1 解压
tar -zxvf jdk-8u191-linux-x64.tar.gz
4.2 配置环境变量
vi /etc/profile
在文件最后添加
## java export JAVA_HOME=/usr/local/java/jdk1.8.0_191 export PATH=$JAVA_HOME/bin:$PATH
4.3 刷新配置文件
source /etc/profile java -version