How can I include platform-specific native libraries in the .JAR file using Eclipse?

Posted by Martin Wiboe on Stack Overflow See other posts from Stack Overflow or by Martin Wiboe
Published on 2010-04-23T21:41:17Z Indexed on 2010/04/23 21:43 UTC
Read the original article Hit count: 410

Filed under:
|
|
|
|

Hello all,

I am just starting to learn JNI. I have been following a simple example, and I have created a Java app that calls a Hello World method in a native library. I'd like to target Win32 and Linux x86.

My library resides in a DLL, and I can call it just fine using LoadLibrary when the DLL is added to the root of my Eclipse project.
However, I can't figure out how to get Eclipse to export a runnable JAR that includes the DLL and the .SO file for Linux.

So my question is basically; how would you go about creating a project in Eclipse and include several versions of the same native library?

Thank you,
Martin

© Stack Overflow or respective owner

Related posts about jni

Related posts about java