Strongly encapsulate all internal elements of the JDK by
default, except for critical internal
APIs such as sun.misc.Unsafe
. Allow end users to
choose the relaxed strong encapsulation that has been the default
since JDK 9.
With this change, the default value of the launcher option
--illegal-access
is now deny
rather than
permit
. As a consequence, existing code that uses most
internal classes, methods, or fields of the JDK will fail to run.
Such code can be made to run on JDK 16 by specifying
--illegal-access=permit
. That option will, however, be
removed in a future release.
For further details, please see JEP 396.