I have imported the jenkins jobs from existing jenkins server from another machine. But the problem is, it has the JDK referenced as per the old machines and I want to change it to use the JDK configured in my new jenkins. But I am unable to find any way of doing this. So, please if you have come across this situation and found a way then please help me too.
Thanks.
On the Jenkins Main Page, to the Left click "Manage Jenkins." Access "Global Tool Configuration" menu, and under this menu there is a location about half way down that should say "JDK Installations." Click that button and it will open a new menu where you can add an alternate JDK.
You can add a JDK version by navigating to Jenkins -> Manage Jenkins -> Global Tool Configuration. The global tool configuration menu will open the following window: Next, click the JDK Installations” button under the JDK section to configure multiple JDK versions.
Jenkins project performs a full test flow with the following JDK/JREs: OpenJDK JDK / JRE 11 - 64 bits. OpenJDK JDK / JRE 17 - 64 bits.
Yes, Jenkins allows builds to run with many different JDK versions. We use Java 8, Java 11, and Java 17 regularly on ci.jenkins.io with the controller running Java 11. There are many users that run multiple JDK versions with Jenkins jobs. It works very well.
There is a JDK dropdown in "job name" -> Configure in Jenkins web ui. It will list all JDKs available in Jenkins configuration.
For existing jobs you're editing, the JDK drop-down choice may not be available if you've just added a single JDK config in the 'Configure System' Jenkins settings.
However, it is available for new jobs.
Surprisingly, if you add a second JDK config, it becomes available in an existing job too.
This looks to me like a bug (tested in Jenkins ver. 1.629).
See a similar issue raised here: JDK selection is hidden even when a JDK is configured
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With