Centos7.4安装JAVA8
1.检查本机是否安装过java
rpm -qa | grep java
2.检查本机是否安装过java
rpm -e --nodeps 系统自带jdk名
3.创建java目录
mkdir -p /usr/local/java
4.解压JDK
tar -zxvf /usr/local/jdk-8u162-linux-x64.tar.gz -C /usr/local/java
5.添加到 /etc/profile中
export JAVA_HOME=/usr/local/java/jdk1.8.0_191
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
6.更新配置环境
source /etc/profile