14

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?

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
  • At the bottom, it all comes to JNI. So, why not to use JNI ;) http://jnicookbook.owsiak.org – Oo.oO Jun 30 '17 at 10:51
  • 1
    @Oo.oO: You don't need an extra build step and compilers for different platforms in your build pipeline when you can also just specify things in Java. – Daniel Jun 10 '19 at 07:32

2 Answers2

13

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

Mike Adamenko
  • 2,944
  • 1
  • 15
  • 28
2

The presentation you linked gave part of the answer already - so just continue reading. E.g. on slide 26 and ff:

Why Not JNA?

  • Preprocessor constants?
  • Standard API sets out of the box
  • C callbacks?
  • Performance
Lonzak
  • 9,334
  • 5
  • 57
  • 88