Will we need to use the --enable-native-access option to enable JNI in the future?
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Sep 20 10:17:01 UTC 2021
Hi,
While we do not any plan to require so now, many of the reasons as to
why the flag is added for the foreign Panama API hold true for JNI code.
As such, It would be not unreasonable, some day, to use the same
mechanism to restricted access to both (since, after all, there is no
way for the static compiler, or the JVM, to prove that a program using
JNI is sound). If we go down this path, it is very likely that it won't
be a flag-day, where, say, JDK 30 does not require the flag, but JDK 31
does. It is more likely that we will go through a number of intermediate
releases where the lack of a flag will result in a runtime warning (not
unlike to what has been done with illegal reflective access violation
for modules).
Maurizio
On 19/09/2021 12:11, Glavo wrote:
> At present, it seems that JNI will not be restricted. Will the state be
> modified in the future?
More information about the panama-dev
mailing list