JNIWrapper and Java 10

76 views
Skip to first unread message

inferna...@gmail.com

unread,
Apr 10, 2018, 9:59:58 AM4/10/18
to JNIWrapper Forum
We're seeing a failure that's very similar to what we saw here: https://groups.google.com/a/teamdev.com/forum/#!topic/jniwrapper-forum/bjm0Q2g_dOg when using Java 10 - we're using 3.11, but I believe 3.12 doesn't help either. The details on how we use JNIWrapper are in that other thread, and the fix that we applied at our end for Java 9 no longer works.

The exact failure is something like.
Caused by: com.jniwrapper.LibraryNotFoundException: Cannot find JNIWrapper native library (libjniwrap.jnilib) in java.library.path: /Users/nacho/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.

This is still on macOS, I'm afraid we haven't tested yet on other OSes.

Going through the history of the previous issue, I now see that there was an additional comment about the issue being identified (at least for Java 9). Is there a new build available with the fix that we could try?

Thanks!
Brian.




Vladimir Ikryanov

unread,
Apr 11, 2018, 11:14:39 AM4/11/18
to inferna...@gmail.com, JNIWrapper Forum
Hi Brian,

The current JNIWrapper release version 3.12 does not officially support Java 9 & 10 because this version of JNIWrapper was released before Java 9.

In general, it is possible to launch JNIWrapper on Java 10 by overriding the "java.runtime.version" Java property and set it to "1.8.0". After that, you need to call the Library.loadNativeCode() to force loading the native library and reset the "java.runtime.version"  Java property. The following sample code demonstrates the approach:

String key = "java.runtime.version";
String originalValue = System.getProperty(key);
System.setProperty(key, "1.8.0");
Library.loadNativeCode();
System.setProperty(key, originalValue);

All these actions should be done before using any JNIWrapper-related classes. Could you please try this approach and let us know the result?

Regards,
Vladimir Ikryanov

--
You received this message because you are subscribed to the Google Groups "JNIWrapper Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jniwrapper-for...@teamdev.com.
To view this discussion on the web visit https://groups.google.com/a/teamdev.com/d/msgid/jniwrapper-forum/8ba1be19-1e22-4c7b-80dc-e44e5820dcf7%40teamdev.com.
Reply all
Reply to author
Forward
0 new messages