ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
版本:jdk1.8 ***** **1.下载** 下载jdk1.8  去官网下载jdk https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ``` wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz ``` **2.解压** ``` [root@localhost /]# mkdir /usr/local/java [root@localhost /]# tar -zxvf jdk-8u191-linux-x64.tar.gz -C /usr/local/java/ ``` **3.修改配置文件,设置环境变量** 编辑/etc/下的profile文件,配置环境变量 ``` [root@localhost /]# vim /etc/profile ``` 编辑/etc/下的profile文件,配置环境变量 ``` export JAVA_HOME=/usr/local/java/jdk1.8.0_191 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH ``` **4.使/etc/profile生效** ~~~ [root@bogon /]# source /etc/profile ~~~ **5.测试** ``` [root@localhost /]# java -version java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode) ```