jdk8安装
#1.下载
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
#2.解压安装
tar -vxf jdk-8u131-linux-x64.tar.gz
#3.安装目录
/usr/local/jdk1.8.0_131
#4.添加环境变量
vi /etc/profile
在最后新增以下两行:
export JAVA_HOME=/usr/local/jdk1.8.0_131
export PATH=$PATH:$JAVA_HOME/bin
#5.使用该命令生效
source /etc/profile
#6.检验是否安装成功
java -version