javajava-native-interfaceterminologyjnajnr

What is the difference between JNA and JNR


According to the image from here
enter image description here

both libraries work according to the same principle. But I believe that there is a difference between them. What is this difference?


Solution

  • JNA uses reflection to call native methods.

    JNR generates bytecode in runtime only once therefore JNR works faster then JNA. See example of code generating here