jdk-8u181-linux-x64.tar.gz 下载并拷贝到Linux中
1.创建文件夹并解压
[]# mkdir /usr/java
[]# tar -xzvf jdk-8u45-linux-x64.gz -C /usr/java/
2.授权
[]# cd /usr/java
[]# chown -R root:root jdk1.8.0_181
3.配置环境变量
[]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_181/bin/java
export PATH=PATH
[]# source /etc/profile
4. 检验
[]# which java
/usr/java/jdk1.8.0_45/bin/java