How to express dependency in maven on java ee features for transition to Java 9?

The Module System speaks of the way the unnamed modules as in your case of loading the application from classpath constructs the module graph. Further, from the documentation itself:- When the compiler compiles code in the unnamed module, or the java launcher is invoked and the main class of the application is loaded from the … Read more

List the modules resolved during the application startup

Module Resolution The module resolution is a two-step process. The first step recursively enumerates the ‘requires’ directives of a set of root modules. If all the enumerated modules are observable, then the second step computes their readability graph. The readability graph embodies how modules depend on each other, which in turn controls access across module … Read more

Package conflicts with automatic modules in Java 9

Am I using the new module system correctly? Yes. What you are seeing is intended behavior, and this is because JPMS modules do not allow split packages. In case you are not familiar with the term “split packages” it essentially means two members of the same package coming from two different modules. For example: com.foo.A … Read more

How to solve InaccessibleObjectException (“Unable to make {member} accessible: module {A} does not ‘opens {package}’ to {B}”) on Java 9?

The exception is caused by the Java Platform Module System that was introduced in Java 9, particularly its implementation of strong encapsulation. It only allows access under certain conditions, the most prominent ones are: the type has to be public the owning package has to be exported The same limitations are true for reflection, which … Read more

Unable to derive module descriptor for auto generated module names in Java 9?

The solution to this seems to be:- A way possible to uninterruptedly using the same artifact name with a new(different) module name could be by packaging META-INF/MANIFEST.MF of the artifact with an attribute Automatic-Module-Name which governs the name of the module to be used by the module descriptor when converted as an automatic module. OR … Read more