vendredi 2 octobre 2020

How to find all available Java-modules via reflection etc

How is it possible to find all java.lang.Modules reachable from a ClassLoader? I'm writing a little tool to help diagnose class loading troubles, but I haven't been able to find a good way to do this. The closest approximation I found would be to use the hierarchy spanned by the ModuleLayer and his parents of a class' Module, but this sounds rather cumbersome and I'm not sure whether I would find all modules there.

Alternatively, I'd need to find the java.lang.Module with a certain name, but that'd be my second choice.

Thanks so much!





Aucun commentaire:

Enregistrer un commentaire