a simple native loader for java
use SimpleLibInfo
try {
NativeLoader.load(new SimpleLibInfo("x"));
} catch (Exception e) {
LOGGER.warn(e.getMessage(), e);
throw e;
}
the NativeLoader
will try to:
- try to load the library from the system path
- try to load the library from the classpath, and copy it to the tmp directory
- try to load the library from given path by set in java env
implement LibInfo
public class LibAInfo implements LibInfo {
...
}
// usage
try{
NativeLoader.load(new LibAInfo());
} catch (Exception e) {
LOGGER.warn(e.getMessage(), e);
throw e;
}