Is there any way of accessing Java 9's bootstrap classes from within Java
12 to access Java 9's bootstrap classes? If run using Java 12, the snippet
below always finds the Java 12 file system rather than the required Java 9
file system.  My immediate issue is that I am inappropriately finding
java.lang.constant.Constable when searching for the implemented interfaces
of java.lang.invoke.MethodHandle in Java 9 bytecode.

String targetImage = <...Java9_HOME...>
URL url = Paths.get(targetImage, "lib", "jrt-fs.jar").toUri().toURL();
URLClassLoader loader = new URLClassLoader(new URL[] { url });
FileSystem fs = FileSystems.newFileSystem(URI.create("jrt:/"),
Collections.emptyMap(), loader);

Reply via email to