How has calling C libraries changed in recent Java versions?

In recent Java versions, calling C libraries has evolved with the introduction of the Java Native Interface (JNI) and the Java Native Access (JNA). These tools allow developers to interface with C libraries more easily and efficiently, improving performance and making it simpler to integrate with existing native code.
java, JNI, JNA, native libraries, Java C integration, performance optimization
// Example of calling a C library using JNI in Java public class Example { // Load the native library static { System.loadLibrary("nativeLib"); } // Declare a native method public native void sayHello(); public static void main(String[] args) { new Example().sayHello(); // Call the native method } }

java JNI JNA native libraries Java C integration performance optimization