JNAJava Native Access is an extension to Java that allows the use of native APIs by including dynamically library files, DLLs under Windows.
JNA is a simpler alternative to JNI which does not require to generate code for using C functions. To use them, simply include the file that defines them and declare the header of these functions in an interface.
DemonstrationTo use the puts function of the C language, which is provided by the msvcrt.dll file in Windows, create the following interface:
package CInterface;
import com.sun.jna.Library;
public interface CInterface extends Library
{
public int puts(String str);
}We have declared the CInterface interface which is a subclass of J