Advice on JNA v.s. JNI

315 views
Skip to first unread message

Matan

unread,
Jul 8, 2017, 12:16:44 PM7/8/17
to Java Native Access
Hi,

Would you recommend using JNA also for the case that one suffices with running only on linux systems, or even a limited subset of linux distributions? Why so? Which features, in particular, would be worth the extra library dependency, in your opinion?

Thanks,
Matan

Kustaa Nyholm

unread,
Jul 8, 2017, 1:17:21 PM7/8/17
to jna-...@googlegroups.com
My first choice is always JNA over JNI.

It totally side steps the hell called C-tool chain so it is most of the time trivial to 
get off the ground and up to speed. Development and especially maintenance
in different (than original development) environments is so much easier.

Well worth the extra dependency even for a single call to OS API, IMO.

Just include the JNA in your path, write a few lines of Java and you can
call almost any API function that takes native parameters, complex
paramaters take a few more lines but often are trivial too.

Try that with JNI.

wrb Kusti


--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages