Program is compiled with JDK8. I want to run the code with JDK11(without recompilation of the code with JDK11).
Problem is that the program use classes from JDK8 tools.jar(classes that are now in the jdk.compiler module in jdk11,the tools.jar is added to the classpath). In JDK11 there is not separate jar for the tools but instead of its the part of the JDK11. So there is class clashes (class is in JDK11 and also in the tools.jar that is on classpath). The classes from JDK11 has precedence before classes from tools.jar. Is there any possibility to tell the JVM that it should use classes from tools.jar instead of the classes from JDK11.
Updates As I said I can not recompile the code with JDK11. I know about Java module system introduced in Java9. What I ask is if there is possibility to tell the JVM to ignore the classes from the JDK11 module jdk.compiler and instead of that use the classes that he founds on the classpath.