How to keep using Jenkins with Java 8

692 views Asked by At

Post version 2.346.x, Jenkins forces us to upgrade to Java 11. However, our company policy asks us to stick to Java 8 across all the projects, whatsoever the case would be. (Obvious reason being the budget).
I know that we can still download and install the older version of Jenkins. The problem here is, after some point of time, most of the plugins stop supporting the older Jenkins. Now I can neither upgrade to latest version of Jenkins nor can I stay back on older and keep using the plugins.

So here comes the question - Is there a way to keep using Java 8 compatible Jenkins and all the plugins?

1

There are 1 answers

1
Cyb.org On

If you are using Debian or Ubuntu you can pin a package to the choosen version in the APT configuration

root@debian:~# cat /etc/apt/preferences.d/jenkins
Package: jenkins
Pin: version 2.346
Pin-Priority: 1000

root@debian:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@debian:~# rm /etc/apt/preferences.d/jenkins

root@debian:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  jenkins
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/92.9 MB of archives.
After this operation, 2,204 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
root@debian:~#