1、下载
https://download.java.net/java/GA/jdk18.0.2.1/db379da656dc47308e138f21b33976fa/1/GPL/openjdk-18.0.2.1_linux-x64_bin.tar.gz
2、安装
[root@test ~]# tar -zxvf openjdk-18.0.2.1_linux-x64_bin.tar.gz -C /usr/local/
[root@test ~]# vim /etc/profile
export JAVA_HOME=/usr/local/jdk-18.0.2.1
export JRE_HOME=/usr/local/jdk-18.0.2.1
export PATH=$
JAVA_HOME/bin:$
PATH
[root@test ~]# source /etc/profile
3、查看版本
[root@test ~]# java -version
openjdk version “18.0.2.1” 2022-08-18
OpenJDK Runtime Environment (build 18.0.2.1+1-1)
OpenJDK 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)
Linux升级java18
于 2022-10-25 15:55:08 首次发布