Looks like the ModuleLayer.defineModules is the thing I needed.
With it, I can use my current classloader to load all the modules
and it can find the classes from both module and unnamed module.
Note that class loaders for modules behave differently then original
class loaders. For example they
The bidirectional delegation is an important point. Beside that, you
also mentioned that your custom class loader stores additional information.
Unfortunately, I cannot only remove the jars from my classloader and
delegate
to the classloader provided by the ModuleLayer because we use a custom
Note that you are actually loading the JARs twice which means that you
might have two versions of the same classses loaded, not only of the
resources. Is this intentional? I still don't know what you want to
achieve with your class loader and module layer.
Am 02.01.2021 um 21:06 schrieb Thiago
I think you need to specify the "implementation modules" in the last
argument of Configuration.resolveAndBind(...).
Best regards,
Johannes
Am 15.11.2020 um 20:16 schrieb Alex Orlov:
Hi all,
I create JPMS layer this way:
Configuration cf = parentLayer.configuration().resolveAndBind(module