On 26/03/2021 10:09, Christian Stein wrote:
Thank you for the clarification, Alan.

First, I fixed the problem as you suggested by adding
--add-modules ALL-SYSTEM to the java command.
It yielded warnings about incubator modules, though:

  WARNING: Using incubator modules:
  jdk.incubator.vector, jdk.incubator.foreign
I should have mentioned that, this arises because "ALL-SYSTEM" is all modules in the runtime image so it includes the incubating modules that aren't resolved by default.



Next, I went with --add-modules ALL-DEFAULT
That fixed the runtime issues with jdk.xml.dom

Later that day, Jorn Vernee suggested another
fix [1], that works (for Bach) also at runtime without
using the --add-modules X at the command line.
Basically, it puts a ModuleFinder.ofSystem() as
the after component of the custom module layer
Bach creates for running ToolProvider services.

That probably works in this case but it won't work in general because the standard (java.*) modules and many of the JDK-specific (jdk.*) modules cannot be mapped to class loader others than the boot and platform class loaders.

-Alan

Reply via email to