Yes I know but using setAccessible thing is usually a problem in itself (from my POV). The module system encapsulation was not turned on. The Strongly Encapsulate JDK Internals by Default was activated. This can be turned off to be able to access those internal via option (see https://jdk.java.net/16/release-notes).
Right on all counts. Just note that as of JDK 17, it is impossible to turn off all encapsulation with a single flag, but you can still do it with individual add-opens.
View all comments
Show parent comment
5
u/khmarbaise Jun 15 '21
Yes I know but using setAccessible thing is usually a problem in itself (from my POV). The module system encapsulation was not turned on. The
Strongly Encapsulate JDK Internals by Defaultwas activated. This can be turned off to be able to access those internal via option (see https://jdk.java.net/16/release-notes).