Unable to compile modules with references to automatic modules - "cannot find module: jdk.management.resource"
jonathan.gibbons at oracle.com
Mon Nov 9 18:44:31 UTC 2015
On 11/09/2015 12:55 AM, Alan Bateman wrote:
> On 08/11/2015 17:51, Jan Lahoda wrote:
>> Automatic modules depend on all other named modules, and javac
>> currently uses all modules it knows about, which includes those it
>> found while analyzing other module-infos. I think it could be changed
>> to only include modules found on the module paths.
> I assume this will need to re-visited. If javac gets -limitmods then
> it will limit the set of observable modules and so qualified exports
> to modules that aren't in that set will need to be ignored. It's also
> tied to -addmods and getting javac consistent with run-time where
> automatic only require java.base for the purposes of resolution but
> read all other modules.
> In any case, it won't be possible to compile code that references to
> types in the "missing" modules and so I assume shouldn't change javac
> behavior to not use the qualified exports.
Yes, this all needs to be fixed.
javac's ModuleFinder currently scans all modules on the aggregate module
path; it needs to be updated to match the runtime behavior, which is to
scan system modules, plus any modules in and reachable from the root
set, plus any modules requested with -addmods.
More information about the jigsaw-dev