最新版本的jenkins已经不支持,jdk1.8,但是由于开发环境大家都用的jdk1.8在开发,也不想在服务上换高版本的jdk所以有此下文。
jenkins 版本支持情况如下:
https://www.jenkins.io/doc/book/platform-information/support-policy-java/Java Support Policy
There are separate runtime and job execution requirements for Jenkins installations.
Running Jenkins system
The following Java versions are required to run Jenkins:
Supported Java versions Long term support (LTS) release Weekly release Java 17 or Java 21
2.479.1 (October 2024)
2.463 (June 2024)
Java 11, Java 17, or Java 21
2.426.1 (November 2023)
2.419 (August 2023)
Java 11 or Java 17
2.361.1 (September 2022)
2.357 (June 2022)
Java 8, Java 11, or Java 17
2.346.1 (June 2022)
2.340 (March 2022)
Java 8 or Java 11
2.164.1 (March 2019)
2.164 (February 2019)
Java 8
2.60.1 (June 2017)
2.54 (April 2017)
Java 7
1.625.1 (October 2015)
1.612 (May 2015)
jenkins 最后一个支持jdk 1.8 的版本就是2.346 ,下载地址如下:
https://mirrors.huaweicloud.com/jenkins/war/2.346/jenkins.war
下载后启动服务java -jar jenkins.war 提示如下错误,一看服务器内存空闲还有6G,查了下是ulimit 的问题。
library initialization failed - unable to allocate file descriptor table - out of memoryAborte
echo "ulimit -c unlimited" >>/etc/profile
echo "ulimit -s unlimited" >>/etc/profile
echo "ulimit -SHn 65535" >>/etc/profile
source /etc/profile
然后就可以正常启动了 jenkins 默认启动端口8080。