-
Sub-task
-
Resolution: Delivered
-
P3
-
17
-
Verified
Strongly encapsulate all internal elements of the JDK, except for
[critical internal APIs][crit] such as `sun.misc.Unsafe`.
With this change, the `java` launcher option [`--illegal-access`][relax]
is obsolete. If used on the command line it causes a warning message to
be issued, and otherwise has no effect. Existing code that must use
internal classes, methods, or fields of the JDK can still be made to work
by using the [`--add-opens`][add-opens] launcher option, or the
[`Add-Opens`][modjar] JAR-file manifest attribute, to open specific
packages.
For further details, please see [JEP 403](https://openjdk.java.net/jeps/403).
[crit]: https://openjdk.java.net/jeps/260#Description
[relax]: https://openjdk.java.net/jeps/261#Relaxed-strong-encapsulation
[add-opens]: https://openjdk.java.net/jeps/261#Breaking-encapsulation
[modjar]: https://openjdk.java.net/jeps/261#Packaging:-Modular-JAR-files
[critical internal APIs][crit] such as `sun.misc.Unsafe`.
With this change, the `java` launcher option [`--illegal-access`][relax]
is obsolete. If used on the command line it causes a warning message to
be issued, and otherwise has no effect. Existing code that must use
internal classes, methods, or fields of the JDK can still be made to work
by using the [`--add-opens`][add-opens] launcher option, or the
[`Add-Opens`][modjar] JAR-file manifest attribute, to open specific
packages.
For further details, please see [JEP 403](https://openjdk.java.net/jeps/403).
[crit]: https://openjdk.java.net/jeps/260#Description
[relax]: https://openjdk.java.net/jeps/261#Relaxed-strong-encapsulation
[add-opens]: https://openjdk.java.net/jeps/261#Breaking-encapsulation
[modjar]: https://openjdk.java.net/jeps/261#Packaging:-Modular-JAR-files