[Rxtx] rxtx moving from JNI to JNA (was Re: About JRE crashes)

Lucio Crusca lucio at sulweb.org
Tue Aug 17 01:39:25 MDT 2010


August 17 2010 08:59:22, George H wrote:

> In my opinion JNA is just a proxy pattern for gluing the native libs
> to your java code.

I believe it is more effectively used to glue your java code to *others* native 
libs (e.g. host OS native libs). 

> Lets say you used JNA with rxtx, you would still
> needed to code, compile and debug the windows DLL and the linux SO
> files anyways. In fact this may make development a bit harder.

The point is, with JNA you don't need to write native code in C anymore, you 
write it in java and call OS native libs directly from java when needed with 
runtime lookup of function pointers. This way compilation is easier for users 
of the rxtx library. I agree debugging and developing rxtx can become a little 
harder. That said, I've no practical JNA knowledge, so it's more than likely 
that I miss some important JNA details.

August 17 2010 08:43:48, Kustaa Nyholm wrote:
> What I was suggesting was to just do the low level access to the OS using
> JNA. If and when a POSIX emulation (or equivalent mechanism) is needed that
> can easily be coded in Java.

Exactly what I mean.

August 17 2010 08:56:47, Adrian Crum wrote:
> Are you experiencing that headache with this project in particular? I
> haven't used C in years, and I was able to download the RXTX repo, set up
> my dev environment and get it to compile within a few hours.

*A FEW HOURS*? Such a time to setup a build environment is way too much for 
most rxtx users (non-rxtx-developers), especially since it is a very commonly 
suggested way to grab the best rxtx code. A library user expects to be able to 
download it and use it in a few seconds, not hours. For example I need just 
now to grab the sources only for the crashes problem, and "a few hours", 
assuming all goes well, seem a bit too much since I don't plan to become a 
rxtx developer.

I think JNA could make this situation better.

My 2 cents,
Lucio.



More information about the Rxtx mailing list