Configure Java 8 node in a Java 11 Jenkins Server

Jenkins setup:
Version 2.426.2
Installation followed this page: Linux

My Jenkins server has a Java 11 version and my applications run using openJDK-8.

I am trying to create a node from a docker container that uses a custom image. My Dockerfile uses as base image the jenkins/ssh-agent:latest-jdk8.

When I setup the node and launch the agent, I am getting the error below:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at sun.launcher.LauncherHelper.checkAndLoadMain(
Agent JVM has terminated. Exit code=1

So, my question is: Is it possible to launch a java 8 node into a java 11 jenkins server? If yes, can someone give how can I do this configuration?

Thank you.

the agent java process must be java 11, but nothing stops you from installing also jdk8 on your agent and make sure that your build process is using jdk8

1 Like

Thanks. I was able to run the node with java 11 and then run pipelines using java 8.