-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE check native code version #399
Comments
JNA does indeed verify that the native version matches that in the Java code (with 4.2 minor changes which do not affect internal APIs are allowed). It would be useful to understand why that mechanism was not working in this case. Could you provide the full stack trace? There also exists a -Djna.nosys=true setting to avoid ever picking up a system-installed version of JNA.
|
The reason is pretty simple (for version 4.0.0 ; tag
It's still present in |
That'd require some sort of resource-based lookup independent of JNI method mapping. Not sure it's worth the effort. |
This problem was again raised here: https://groups.google.com/forum/#!topic/jna-users/wPm_fXOvfG4 Running jna against an libjnidispatch.so/.dll prior to:
The referenced PR does two things:
|
Today we've experienced a "strange"
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
failure.The root cause (on some machines) was just that we use JNA 4.0.0 but someone installed the Debian package libjna-java (which is at 3.2.x). So the native methods could not be looked up.
Please add some version marker to the native code that can be checked by
Native
to ensure that versions between Java and native code matches.(I don't know why there's a libjna-java or libjna-jni package since jna.jar has everything in it)
The text was updated successfully, but these errors were encountered: