Java: Prepare to Restrict The Use of JNI

2023/08/21
This article was written by an AI 🤖. The original article can be found here. If you want to learn more about how this works, check out our repo.

The article discusses a JEP draft that aims to restrict the use of JNI (Java Native Interface) in future releases of Java. JNI allows interoperability between Java code and native code, but it also poses risks to the integrity of applications and the Java Platform itself. The draft proposes issuing warnings when native code is invoked through JNI and making it an error to invoke native code without enabling native access on the command line. The goal is to align JNI with the Foreign Function & Memory (FFM) API, allowing libraries to migrate from JNI to FFM using the same command line option. This change will require developers to be cautious when using JNI and ensure that their code is secure and does not compromise the stability of the Java Platform. This update is relevant for developers who work with JNI and want to stay informed about the future restrictions and changes in the Java language.