Possible Duplicate:
How to bundle a native library and a JNI library inside a JAR?
I need to include native lib (jnotify but I think that it does't matter) to my jar. I want to do it with NetBeans.
I added Bundle-NativeCode: /lib/jnotify.dll; osname=win32
to my manifest.mf
file and added jnotify.dll
to projektHome\src\lib\
folder. But unfortunately NetBeans is overidning manifest.mf
file.
How can I fixed? Can I do this using only NetBeans? Is it line 'Bundle-NativeCode: /lib/jnotify.dll; osname=win32
correct? I also heard I should put dlls hash in manifest.mf
and sign my jar. Is that true?
I don't think the Java executable supports Bundle-NativeCode
. I'm pretty sure that is an OSGi attribute. The list of supported attributes is defined in the JAR File Specification.
Outside frameworks that provide it, there is no built-in support for bundling native libraries inside JAR files. If I recall correctly, it is possible to extract the file to a temporary location and load it manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With