Which Java version should I run Jenkins with?

40,699

Solution 1

Update 2017: After "Jenkins Upgrades To Java 8 (January)" and PR 2802, JDK 8 will be mandatory for Jenkins 2.54 or more (April 2017).


You can use any jdk (1.5+ 1.7+ for 1.608+) you want for Jenkins: this is separate from the JDK that a job would use (either a job running on the master, or on a slave).

So it doesn't really matter: using one JDK for running Jenkins won't prevent you to use any other JDK for your jobs.

Update 2015: Jenkins just said good by to JDK6 (2015-04-06)

About two years ago, we bumped our runtime JRE requirement from Java5 to Java6. And so the time has come once again for us to finally move on to Java7.
Because of all the new language features, many of us the developers really wanted to move right on to Java8, but after much discussion we settled to move to Java7 first and then to Java8.

Solution 2

Jenkins now requires Java 8 or 11. To cite Jenkin's Java Requirements:

Running Jenkins

Modern Jenkins versions have the following Java requirements:

  • Java 8 runtime environments, both 32-bit and 64-bit versions are supported

  • Since Jenkins 2.164 and 2.164.1 2, Java 11 runtime environments are supported

    • Running Jenkins with Java 11 is documented here
    • There are some precautions to take when upgrading from Java 8 to Java 11 in Jenkins, please follow these guidelines.
  • Older versions of Java are not supported

  • Java 9 and Java 10 are not supported

  • Java 12 is not supported

Solution 3

As of Version 2.38 of Jenkins it's possible to use JDK 1.8.

Solution 4

If a project, Jenkins here, does not recommend any specific JRE version I would go with one of the current stable version recommended by Oracle.

But as I think that Java 8 is generally not ready for production at the moment of writing these words and as there have been some Java 8-specific bugs in Jenkins I would use JRE 7.


For 64-bit Windows Oracle has a special server JRE 7 64-bit version, documented here, available for download here.

For 32-bit Windows just go with latest standard JRE 7 32-bit, available here.

Share:
40,699

Related videos on Youtube

Martin
Author by

Martin

C++

Updated on September 18, 2022

Comments

  • Martin
    Martin over 1 year

    Reference: Jenkins Users :: Jenkins on Windows: Java + JRE (version) confusion

    Which Java version should I run Jenkins with (on Windows)? Should I use the included JRE of the Windows master? Should I use the last 1.6 release? Should I just run it on a current 1.7 version? (Note that I'm running the stand-alone version.)

    All I could find on the Jenkins pages was: To run Jenkins, minimally you need to have JRE 1.5 or later.

    Aside: My Windows server(s) are still 32bit 2k3, but what do you run Jenkins with on 64 bit platform? 32bit or 64bit JVM?

    Note that this question is only about the JRE (or JDK) I use to run the Jenkins instance(s) with. I'm not concerned with the JDK used to build Java programs.

  • Martin
    Martin about 11 years
    Yeah, I know that I can. Question is, isn't there anything recommended? (I added a note about JDK for building - I'm not concerned with that one.)
  • VonC
    VonC about 11 years
    @Martin no, there isn't anything recommended: the easiest is to use the JDK that it will find in the PATH (as mentioned in this book for instance).
  • Martin
    Martin about 11 years
    It'd be interesting what Jenkins on Jenkins uses.
  • VonC
    VonC about 11 years
    @Martin you doesn't seem to be the only one ;) issues.jenkins-ci.org/browse/JENKINS-13585
  • Alexander Trauzzi
    Alexander Trauzzi over 6 years
    Is there anything about JDK vs. JRE to be mindful of? Even if I'm not building java projects?
  • VonC
    VonC over 6 years
    @Omega For Jenkins, a JRE is enough (jenkins.io/blog/2017/04/10/jenkins-has-upgraded-to-java-8). In general, read stackoverflow.com/q/1906445/6309.
  • nnyby
    nnyby almost 6 years
    Does Jenkins currently support Java 9? I can't find their canonical reference for Java compatibility.
  • nnyby
    nnyby almost 6 years
    nvm - I found some info here: issues.jenkins-ci.org/browse/JENKINS-40689 Looks like it's best to just stick with Java 8 at the moment.
  • linuxUser123
    linuxUser123 almost 4 years
    it doesn't require 8 or 11, it supports 8 or 11. so basically that means, use anything not not supported at your own risk (Java 14, for example)