shannah / Java-Objective-C-Bridge

A thin bridge that allows for two-way communication from Java to Objective-C.
123 stars 25 forks source link

Recommended approach to embedding the libjcocoa.dylib in a jar and having it in the java.library.path #6

Closed uchuugaka closed 6 years ago

uchuugaka commented 6 years ago

Is there a recommended approach to embed the dylib into a jar containing the other code? Seems like a logical place to keep it with other code but how to get it there and reference it? (have it in the java.library.path) I think this would be a useful thing, but it is not something I have been successful finding examples of.

shannah commented 6 years ago

This class (currently only part of Maven branch) includes code that loads a native lib from a Jar. You can use that as a blueprint https://github.com/shannah/Java-Objective-C-Bridge/blob/maven/src/main/java/ca/weblite/nativeutils/NativeUtils.java

uchuugaka commented 6 years ago

Just wanted to say a big thank you. It wasn't super simple, but this got me on the right track in so many ways and helped me complete what I needed to do.