Java enhancement proposal would preserve the status of the Java Native Interface as a standard way to interoperate with native code, while disallowing interoperation with native code by default. Credit: jazz3311 / Shutterstock A proposal to preserve the status of Java Native Interface (JNI) as a standard way to interoperate with native code is moving forward in the Java community. Originally created in May 2023 and updated on July 16, the JDK enhancement proposal (JEP), called “Prepare to Restrict the Use of JNI,” is slated for JDK 24, which would not likely arrive until March 2025. The proposal calls for warnings about uses of JNI and adjusting the Foreign Function & Memory (FFM) API to issue warnings in a consistent manner. These warnings are intended to prepare developers for a future release that disallows interoperation with native code by default, whether via JNI or the FFM API. As of that release, developers will have to explicitly enable the use of JNI and the FFM at startup. In addition, the plan would align the use of JNI and the FFM API so that library maintainers can migrate from one to the other without requiring developers to change any command-line options. Non-goals include deprecating JNI or removing JNI from the Java platform and restricting behavior of native code called via JNI. As an example, all of the native JNI functions would remain usable by native code. JNI was introduced in JDK 1.1, which dates back to February 1997, as the primary means for interoperating between Java code and native code, typically written in C. The interface allows Java code to call native code (a downcall) and native code to call Java code (an upcall). But any interaction between Java code and native code is risky because it could potentially compromise the integrity of applications and the Java platform itself. Based on the policy of integrity by default, all JDK features capable of breaking integrity by default must obtain explicit approval from the application’s developer. Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos