I have run into a snag with the JPMS jdk.internal.loader.BuiltinClassLoader when executing main methods in the context of my IDE (I use IntelliJ 2018.1).
If a resource is loaded in an in module class using a standard method like
MyMainClass.class.getResourceAsStream("/some-resource")
The resource is not found because the ModuleReference is not a jar, but a class path, e.g.
[module org.ubl.scb, location=file:///home/christopher/IdeaProjects/systematik-catalogue-builder/web-anno/out/production/classes/]
All of the other entries in the nameToModule Map look like this:
key = "logback.core"
value = "[module logback.core, location=file:///home/christopher/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar]"
Of course, a resource will never be found in classes, but it could be if the location is the jar root.
Is this a bug or am I missing something?