Why is -XD-Xmodule hidden?
Alan Bateman
Alan.Bateman at oracle.com
Sun Jun 11 07:35:44 UTC 2017
On 11/06/2017 08:13, Nicolai Parlog wrote:
> Hi!
>
> When incrementally compiling some of a module's sources it is necessary
> to make the compiler aware that the sources actually belong to that
> module. One way to do this was the non-standard option -Xmodule, which
> was recently demoted to the hidden -XD-Xmodule.
>
> I'm curious to know why.
>
> Example:
>
> javac --module-path mods -d classes
> src/foo.mod/com.example.SomeClass.java
>
> This will compile SomeClass in the unnamed module, making it fail if it
> uses types from bar.mod (even if foo.mod requires it).
>
> I know of three ways to fix this:
>
> * adding module declaration to compile command
> * multi-module declaration
> * option -XD-Xmodule
>
> I found the last option to be conceptually most fitting and also the
> least troublesome.
>
-Xmodule was folded into --patch-module some time ago. Just add
`--patch-module foo.mod=src/foo.jmod` to the above.
I'll have to defer to Jon or Jan as to why -Xmodule wasn't removed. As I
recall, it was made hidden to allow for transition but I thought that
was temporary.
-Alan
More information about the jigsaw-dev
mailing list