The root problem is that there is an older version of JNA installed on the system:
$ dpkg -l | grep -i jna
ii libjna-java 3.2.7-4 Dynamic access of native libraries from Java without JNI
JNA starts up by trying to load its bootstrap native library. It searches for this in various places, as described in the documentation.
The problem is fixed by using the -Djna.nosys=true
flag, which forces JNA to load the native library from your jna.jar
, not from the system.
Setting the java.library.path
to a nonsense value has a similar side-effect - it overwrites the normal java.library.path
, preventing the system version of JNA from being loaded, and falling back on the version from your local jna.jar
.
The debug setting -Djna.debug_load=true
is also useful for diagnosing JNA problems.