6

I need to update Jenkins master to the newer version which requires java new version but my jenkins master machine has older java version.

All my build jobs on the master use maven which uses older java version.

So, if I upgrade java my builds will no longer work.So, is there is solution for this?

6
  • I'd advise that you upgrade all your Java JDKs to version 8. All others have passed their support life.
    – duffymo
    Dec 30, 2016 at 18:40
  • Is there a specific reason you can't fix your builds? After all, they're yours.
    – Esko
    Dec 30, 2016 at 18:51
  • Are you talking about running Jenkins with one version of Java and running individual jobs within Jenkins using a different version of Java?
    – sisyphus
    Dec 30, 2016 at 19:19
  • @Esko I have around 300 builds.I don't want to fix them all.
    – christoph
    Dec 30, 2016 at 19:35
  • @sisyphus you are right.I am talking about running Jenkins with one version of Java and running individual jobs within Jenkins using a different version of Java
    – christoph
    Dec 30, 2016 at 19:36

2 Answers 2

3

https://www.safaribooksonline.com/library/view/jenkins-the-definitive/9781449311155/ch04s05.html

Within Jenkins you can configure multiple different JDKs for you individual job builds. They're configured under the 'Manage Jenkins' -> 'Configure System' page, in the 'JDK' section. Just install each different JDK on a different place in your filesystem, point Jenkins to it and then given it a name on this page.

For any individual job you can just tell it to use a specific version of the JDK, using the name configured above. Jenkins will set JAVA_HOME appropriately. How to change the JDK for a Jenkins job?

After that, running Jenkins using the new JDK is matter of installing the new JDK in an appropriate place and modifying your startup to pick up that version of java.

1

With lates Jenkins version, these settings are under Global Tool Configuration or short /configureTools/: 'Manage Jenkins' -> 'Global Tool Configuration' -> 'Add JDK'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.