Please, consider the following situation: The boot layer contains moduleA, which has the following line in module-info: "opens com.company.a.foo to com.google.gson;" The child layer contains gson.
And this is what I get: java.lang.reflect.InaccessibleObjectException: Unable to make field private ... com.company.a.foo.Bar accessible: moduleA does not "opens com.company.a.foo" to module com.google.gson If I do "opens com.company.a.foo;" then everything works fine, but it is not what I would like to do. Can someone confirm if this is expected behavior? Is this a bug, or does opens/exports moduleA.X to moduleB only work when moduleA and moduleB are in the same layer? Best regards, CR