Java exception with openjdk 17

Jenkins setup:
Controller version: 2.426.3 with openjdk 11
Agent: Windows 11 with openjdk 17.0.10

Hi, we have built a new Windows 11 agent with openjdk 17.0.10 (we normally use openjdk 11). The agent connects and runs ok but we see this in the log:

This is a Windows agent
ERROR: Unexpected error in launching an agent. This is probably a bug in Jenkins
Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to jenkins-win<snip>
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1787)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
		at hudson.remoting.Channel.call(Channel.java:1003)
		at hudson.FilePath.act(FilePath.java:1321)
		at org.jenkinsci.plugins.envinject.EnvInjectComputerListener.onOnline(EnvInjectComputerListener.java:144)
		at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:751)
		at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:441)
		at hudson.plugins.sshslaves.SSHLauncher.startAgent(SSHLauncher.java:645)
		at hudson.plugins.sshslaves.SSHLauncher.lambda$launch$0(SSHLauncher.java:465)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		at java.base/java.lang.Thread.run(Thread.java:829)
java.lang.reflect.InaccessibleObjectException: Unable to make private native java.lang.reflect.Field[] java.lang.Class.getDeclaredFields0(boolean) accessible: module java.base does not "opens java.lang" to unnamed module @2c19a10e
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source)
	at java.base/java.lang.reflect.Method.setAccessible(Unknown Source)
	at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.getModifiers(EnvInjectMasterEnvVarsSetter.java:29)
	at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:55)
	at org.jenkinsci.plugins.envinject.service.EnvInjectMasterEnvVarsSetter.call(EnvInjectMasterEnvVarsSetter.java:19)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Agent successfully connected and online

Is there an incompatibility between Java 11 on the controller and Java 17 on an agent?

See While upgrading Jenkins to 2.426.2 I am getting below when connecting a node to the Jenkins server

Thank you, as explained in that thread (While upgrading Jenkins to 2.426.2 I am getting below when connecting a node to the Jenkins server - #4 by mawinter69) adding this to JVM Options fixed my problem (we use an ssh connection):

--add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED