Dynamically load native library

Viewed 3162

I need a way to load library inside a jar file without extracting it. Is there a way I can use a method like getClass().getResourceAsStream("xxx")

structure will be as follows:

myjar.jar
 - lib/
   - <somelib>.<libext>
 - <package>
   - Foo.class

Where the Foo.class will be the class that loads and connect to the native library and method should also work if the lib folder was inside the <package>

3 Answers
Related