Search code examples
javawindowsjenkinsopenjdk-11

Jenkins on Windows returns unsupported JVM error when Java is updated to OpenJDK 11


I have been testing updating Oracle Java 8 to Red Hat OpenJDK Java 11 on a Windows Jenkins server, but I seem to have hit a wall. My Jenkins instance is stating that Java 11 is unsupported, returning the following error after I updated the JENKINS_HOME JRE files:

"We detected that your JVM is not supported by Jenkins. This is due to the limitation is one of the libraries that Jenkins uses, namely XStream. See this FAQ for more details."

Steps I've taken:

1. Stopped and disabled Jenkins service

2. Uninstalled Oracle Java 8 191 from control panel and removed remaining program files at Java\jdk1.8.0_191

3. Installed Red Hat OpenJDK 11.0.4 msi to Java\jdk11.0.4

4. Updated JAVA_HOME and PATH variables to point to new Java locations

5. Created JRE 11 from the JDK 11 files using all modules in JDK. Specifically I utilized this site for assistance creating the JRE. Placed JRE files on the server in the standard location, Java\jre11.0.4

5. Set Jenkins service to automatic and started it. Confirmed Jenkins site was working properly, then stopped and disabled service again

6. After backing up JENKINS_HOME, replaced the JRE folder there with the jre11.0.4 folder I created from the JDK 11 files.

7. Started Jenkins service. After navigating to the Jenkins site, I received the error message about the JVM being unsupported.

8. Stopped/disabled the Jenkins service, then updated the Jenkins.war to Jenkins 2.194 weekly release. (I was previously running Jenkins LTS 2.176.3.) Started Jenkins service, only to receive the same error.

I'm not sure how to proceed, the "Upgrading Jenkins Java version from 8 to 11" Jenkins documentation isn't much help at this point. The last step in the Upgrading Jenkins section says to "Use a package manager to install the new JVM" and to "Make sure the default JVM is the newly installed version. If it is not, use the correct java command in the Jenkins startup scripts". These instructions appear to be specific to Jenkins instances running on Linux OS. If they are for all OS types, I am unsure how to follow them in a Windows environment.

I've also reviewed Jenkins' documentation for Running Jenkins on Java 11, but didn't find any useful information there either.

And finally the FAQ hyperlink in the error message does not work, and the only information provided by this similarly named XStream site is a note stating XStream requires Java 8, which is in direct conflict with Jenkins' Java documentation that says Jenkins supports Java 8 and 11.

Any suggestions for getting any version of Jenkins to run with OpenJDK 11 or what my next steps should be here would be greatly appreciated.

Software and versions:
- Windows Server 2016
- Jenkins LTS 2.176.3
- Jenkins weekly release 2.194
- Oracle Java JDK and JRE 1.8.0.191
- Red Hat OpenJDK 1.11.0.4 and JRE created from all modules in the JDK files


Solution

  • So it seems I missed the following instructions in the Jenkins.xml file:

    If you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.

    Another member of my team saw this and added a JAVA11_HOME environment to the Jenkins.xml file:

    <env name="JAVA11_HOME" value="D:\Java\jdk11.0.4"/>
    

    And then updated the executable path in the Jenkins.xml:
    From the default:

    <executable>%BASE%\jre\bin\java</executable>
    

    To:

    <executable>%JAVA11_HOME%\bin\java</executable>
    

    Jenkins is finally up and running on Java 11!