CentOS7服务器JDK8安装
- 下载jdk官网
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- 把安装包导入Centos服务器中
- 解压安装文件
tar -zxvf jdk-8u211-linux-x64.tar.gz
- 配置jdk、jre环境变量,全局环境变量的配置文件:vi /etc/profifile
export JAVA_HOME=/usr/local/jdk1.8 #这个路径要改,其余不需要改
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
-
加载环境变量:source /etc/profifile
-
查看是否安装成功:java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
标签:JAVA,java,CentOS7,JDK8,export,HOME,服务器
From: https://www.cnblogs.com/snail05/p/16816276.html