java - Exporting a package from system module is not allowed with --release -
i have following program:
// module-info.java module { } // main.java public class main { public static void main(string[] args) { system.out.println(sun.nio.bytebuffered.class); } }
this program compiles --add-exports
option:
> javac --add-exports java.base/sun.nio=a module-info.java main.java
however, when add --release
argument, fails:
> javac --add-exports java.base/sun.nio=a --release 9 module-info.java main.java error: exporting package system module java.base not allowed --release 1 error
basically, these 2 commands equivalent. why latter 1 forbidden?
also, since idea passes --release
argument javac, makes development in idea impossible if project needs internal api.
i'm using jdk 9+178.
it appears this bug ticket --release
cannot used in combination --add-exports
, --add-reads
, , --patch-module
.
from link:
the overall proposal here make --release 9 work consistently between jdk 9 , (anticipated) jdk 10, @ cost of possible different behavior of commands like:
$ <jdk9>/javac test.java
$ <jdk9>/javac --release 9 test.java
also:
which should acceptable, given intents of --release - allow compile code using supported apis given jdk release.
in particular proposal to:
[edit]
-prevents use of --add-exports, -add-reads , --patch-module system modules in combination --release (any version)
here file diff contains:
exporting package system module {0} not allowed --release
i can't comment on rationale above quote, pertains allowing jdk 9 work consistently jdk 10.
Java - Exporting A Package From System Module Is Not Allowed With
ReplyDelete--Release - >>>>> Download Now
>>>>> Download Full
Java - Exporting A Package From System Module Is Not Allowed With
--Release - >>>>> Download LINK
>>>>> Download Now
Java - Exporting A Package From System Module Is Not Allowed With
--Release - >>>>> Download Full
>>>>> Download LINK sN