JDK-8267055 : Release Note: JEP 403: Strongly Encapsulate JDK Internals
  • Type: Sub-task
  • Component: core-libs
  • Affected Version: 17
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2021-05-12
  • Updated: 2022-03-23
  • Resolved: 2022-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17Resolved
Description
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