I am getting the following error after updating to jdk11.
On analysing the remoting source code found that the hudson.remoting.Launcher.addClasspath invokes URLClassLoader and passes the instance using ClassLoader.getSystemClassLoader().
However in java 11, this seems like an illegal operation as ClassLoader.getSystemClassLoader() does not get the instance of URLClassLoader due to which we are getting the error "object is not an instance of declaring class".
To fix this issue what I have updated the addClasspath to invoke the URLClassLoader using a new instance of the class
This resolved the issue.
Kindly verify if this approach is apt.