内容目录
java8
下载
https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
存档备忘 以便后续使用
解压
mkdir -p /usr/java
tar -zxvf jdk-8u202-linux-x64.tar.gz -C /usr/java
环境变量
sudo vim /etc/profile
#set java environment
#安装目录
export JAVA_HOME=/usr/java/jdk1.8.0_202
#下面都一样
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export JRE_HOME=$JAVA_HOME/jre
重载环境变量
root@iZeb3aw52333n3fnw5jkrhZ:/usr/java# source /etc/profile
root@iZeb3aw52333n3fnw5jkrhZ:/usr/java# java -version
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
openjdk
https://jdk.java.net/archive/
从openkdk9 openjdk11 openjdk17 到最新的openjdk都有 截止20241120目前最新的为openjdk23
举例安装openjdk17
下载
mkdir -p /usr/java
cd /usr/java
wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz
tar -zxvf openjdk-17.0.2_linux-x64_bin.tar.gz
[root@192 jdk-17.0.2]# pwd
/usr/java/jdk-17.0.2
修改环境变量跟上一步一样 jenkins新增jdk也是上面的路径
近期评论