This article, JDK 9: Proposal to allow illegal reflective access by default, claims that the –permit-illegal-access
option will be replaced by a more general option, –illegal-access
.
–illegal-access=permit
–illegal-access=warn
–illegal-access=debug
–illegal-access=deny
➥ Did that happen? Is there a –illegal-access
setting?
➥ How are these set? Arguments to launching the JVM?
➥ How does one get the current value during runtime?
Did that happen? Is there a –illegal-access setting?
Yes, it appears that did happen—at least for OpenJDK/OracleJDK. The option is listed in the documentation for the
java
"tool".It is also listed when executing
java --help-extra
.Note: The JDK-11 documentation mentions this option will be removed in a future release.
How are these set? Arguments to launching the JVM?
Yes, it is a command-line option. Example:
How does one get the current value during runtime?
Unfortunately, I'm not aware of any way to query the value at runtime. It doesn't appear to be part of the system or environment properties. I tried finding where the value was used internally but was unable to (but to be honest I didn't spend too much time looking).
For convenience, here's the documentation of
--illegal-access
for JDK-11: