Community
Participate
Working Groups
The Javac help has this to say about this command line option: --module <module-name>, -m <module-name> Compile only the specified module, check timestamps While there's not much documentation available, running the tool I gather that this is applicable only when --module-source-path option is supplied. But it is not clear what happens when something like the following command is used: javac -d bin --module-source-path src -m mod.one $(find src -name "*.java") The src contains multiple modules and the above command compiles all the modules. Even a command like below ends up compiling both the modules completely: javac -d bin --module-source-path src -m mod.one src/mod.two/q/Y.java Only case where it appears to be working as expected (my understanding) is when no Java file is supplied via the command line.
(In reply to Jay Arthanareeswaran from comment #0) > Only case where it appears to be working as expected (my understanding) is > when no Java file is supplied via the command line. Such as this: javac -d bin --module-source-path src -m mod.one Interestingly, this is the only case where Javac is allowing compilation without passing any source files in the command. If I remove the "-m module", then Javc complains of no source being mentioned. But this doesn't make sense. As of today, ECJ doesn't expect any source files to be passed via the command line in a multi module mode. We will keep it this way until we have more documentation.
Another note: There was no dependency of mod.one on any of other other modules. So, there's no reason to compile the other modules for the sake of resolving dependencies.
More questions: What happens when a module-info.java (1st) is supplied via command line and --module option is used pointing to another (2nd) module? Whatever documents I have doesn't say anything about this. Javac ends up compiling the whole of 2nd module and only the module-info.java of the 1st. None of the other source files from the 1st module are compiled.
New Gerrit change created: https://git.eclipse.org/r/94938
JEP 261 has the following (under "Single-module mode"): "Otherwise if the --module <module> option is present then source files will be compiled as members of <module>, which will be the root module." Ergo, the option doesn't seem to select sources, but *associate* provided source files with the given module.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.