CentOS之安装JDK
程序员文章站
2022-07-05 21:57:20
CentOS安装JDK...
- 下载JDK
cd /home/temp
wget https://download.oracle.com/otn/java/jdk/8u261-b12/a4634525489241b9a9e1aa73d9e118e6/jdk-8u261-linux-x64.tar.gz
- 解压缩
mkdir -p /home/java
tar -zxvf /home/temp/jdk-8u261-linux-x64.tar.gz -C /home/java
- 配置环境变量
编辑/etc/profile
文件,在文件末尾添加如下配置
#Java
JAVA_HOME=/home/java/jdk1.8.0_261
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
- 使配置生效
source /etc/profile
- 检查是否配置成功
[root@VM-0-4-centos home]# java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
本文地址:https://blog.csdn.net/wy0682109523/article/details/107686040
下一篇: api.js总是冲突怎么办?