Debe poner dll en la ruta de su biblioteca (recomendado) antes de intentar cargarlo. para que tenga que extraerlo del jar y copiarlo en la ruta de lib.
private static void loadLib(String path, String name) {
name = System.mapLibraryName(name); // extends name with .dll, .so or .dylib
try {
InputStream in = ACWrapper.class.getResourceAsStream("/"+path + name);
File fileOut = new File("your lib path");
OutputStream out = FileUtils.openOutputStream(fileOut);
IOUtils.copy(in, out);
in.close();
out.close();
System.load(fileOut.toString());//loading goes here
} catch (Exception e) {
//handle
}
}
Nota:ACWrapper
es la clase que sostiene el método estático
compilador no puede encontrar FileUtils y IOUtiles – Oneiros
es necesario agregar [commons-io] (http: // findjar. com/jar/commons-io/commons-io/1.4/commons-io-1.4.jar.html) jar en su classpath –
bien, pero ¿cómo puedo obtener la ruta java lib? – Oneiros