CenterOS7安装java环境

jupiter
2024-07-09 / 0 评论 / 4 阅读 / 正在检测是否收录...

1.下载安装包

wget https://mirrors.tuna.tsinghua.edu.cn/Adoptium/17/jdk/x64/linux/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz

2.解压并移动到目标路径

tar xzvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz
mv jdk-17.0.11+9 jdk17
mv jdk17 /software/

3.配置环境变量

 vim ~/.bashrc
export JAVA_HOME=/software/jdk17
export PATH=$PATH:$JAVA_HOME/bin
 source ~/.bashrc

4.验证

[root@localhost ~]# java -version
openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, sharing)

参考资料

  1. Index of /Adoptium/17/jdk/x64/linux/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
0

评论 (0)

打卡
取消