Deprecate and eventually restrict JNI. Users will need to explicitly enable it via flags like --enable-jni.
To run example you need gcc compiler:
sudo apt update
sudo apt install build-essential
Compile c files
./scripts/jep472/build-native.sh
and run NativeAbs app. You will see warnings :
./scripts/jep472/run-native.sh
Running com.wlodar.jeeps.jep472JNIwarnings.NativeAbs with native library from libs...
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by com.wlodar.jeeps.jep472JNIwarnings.NativeAbs in an unnamed module (file:/home/pawel/IdeaProjects/HelloJava1/target/classes/)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
abs(-42) = 42