Partial module builds create unusable modules

Florian Weimer fw at
Sun Aug 16 15:03:39 UTC 2020

When using --module-source-path, the compiler picks up dependencies
along the module search path and rebuilds missing classes, for modules
not listed under --module.

Unfortunately, that can produce modules that cannot even be discovered
at run time.  One case I encountered is when the module exports a
package, but the modules listed under --module do not reference any
classes in the package.  As a result, the package is not part of the
partial build, and the module cannot be discovered because it is
deemed malformed: “java.lang.module.InvalidModuleDescriptorException:
Package … not found in module”, followed by
“java.lang.module.FindException: Error reading module: …”.

Is this is the expected behavior?  I can see why things are the way
they are, but it's still a bit confusing.

Sorry if my terminology is a bit off; I'm new to this stuff.

More information about the compiler-dev mailing list