Weird use case: compiling against dummy sun.misc.* class

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri May 20 17:02:50 UTC 2016


On 05/20/2016 07:13 PM, Alan Bateman wrote:
> On 20/05/2016 16:55, Aleksey Shipilev wrote:
> jcstress is boot loader so I assume multi-release JARs are out of the
> question?

Yes, a simple workaround would be better than doing MR JARs at this
point. We have >50 Mb JARs as it is, MR JARs would be at least twice as
that if we ship JDK <=8 and JDK >=9 classes in the same package.

> So what is the javac command that you are using? If you are compiling
> sun/misc/Contented.java then I would expect to see `javac
> -Xmodule:jdk.unsupported` so that it is compiled "as if" part of the
> jdk.unsupported module.

-Xmodule:jdk.unsupported definitely works, thanks!

What are the drawbacks for enabling this? I can easily enable that
globally for the entire project, but that would compile all project
files as if in the jdk.unsupported module? I guess that does not matter
if I don't produce/deploy the module as the build artifact.

(Aside: by reading the javac source code, I discovered -XDnoModules,
which also works, but hidden, unsupported, fragile, and scary)

Thanks,
-Aleksey




More information about the jigsaw-dev mailing list