安装步骤
1. 下载jdk-8u131-linux-x64.tar.gz,拷贝到centos里面
2. 解压jdk tar zxvf jdk-8u131-linux-x64.tar.gz
3. 设置环境变量 vim /etc/profile
在文档尾部增加如下配置:
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
在文档尾部增加如下配置:
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_131
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
4.使配置文件生效 source /etc/profile
5.验证 java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)