Mojo

jnilib example

Details

  • Type: Wish Wish
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: osxappbundle
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

I have found no example of how to include a jnilib in the bundle. The problem is that if the artifact is of type jnilib it is placed deep down in the repo directory structure with a name that includes a version number. What you want is the possibility to place the jnilib directly in the Java directory and change the name to not include the version number.

Activity

Hide
Eirik Bjørsnøs added a comment -

Hi Eric,

Support for jnilib deps is definitely something we should support.

It would be really helpful if you could provide a small sample project with a native lib that I could use for testing.

I'll let you know once I have a snapshot ready for testing.

Thanks,
Eirik.

Show
Eirik Bjørsnøs added a comment - Hi Eric, Support for jnilib deps is definitely something we should support. It would be really helpful if you could provide a small sample project with a native lib that I could use for testing. I'll let you know once I have a snapshot ready for testing. Thanks, Eirik.
Hide
Joe Mays added a comment -

Hi Erik,

I just found your osxappbundle plugin, and it's almost everything I need! Just need to be able to include jnilib/dylib native libs. Basically we just need to copy them to Contents/Resources/Java and then System.loadLibrary works with the default java.library.path (i.e., "."). So, if we had something like:

<nativeLibraries>
<fileSet>
<directory>${basedir}/src/main/app-resources</directory>
<includes>
<include>libHelloWorld.dylib</include>
</includes>
</fileSet>
</nativeLibraries>

...where the fileSet would be copied to Contents/Resources/Java, I think that would suffice. Then, System.loadLibrary("HelloWorld") would work.

I can put together an example - just let me know that you're still willing to add this feature!

Thanks,
Joe

Show
Joe Mays added a comment - Hi Erik, I just found your osxappbundle plugin, and it's almost everything I need! Just need to be able to include jnilib/dylib native libs. Basically we just need to copy them to Contents/Resources/Java and then System.loadLibrary works with the default java.library.path (i.e., "."). So, if we had something like: <nativeLibraries> <fileSet> <directory>${basedir}/src/main/app-resources</directory> <includes> <include>libHelloWorld.dylib</include> </includes> </fileSet> </nativeLibraries> ...where the fileSet would be copied to Contents/Resources/Java, I think that would suffice. Then, System.loadLibrary("HelloWorld") would work. I can put together an example - just let me know that you're still willing to add this feature! Thanks, Joe

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated: