[java] AppMain improvements: avoids non-existing library loading

This commit is contained in:
Roman Shevchenko
2016-10-27 12:33:45 +02:00
parent 0305035b5a
commit 723dcd42fe
@@ -53,8 +53,11 @@ public class AppMain {
libName = (arch.endsWith("64") ? "libbreakgen64.jnilib" : "libbreakgen.jnilib");
}
if (libName != null) {
System.load(System.getProperty(PROPERTY_BIN_PATH) + File.separator + libName);
libLoaded = true;
File libFile = new File(System.getProperty(PROPERTY_BIN_PATH), libName);
if (libFile.isFile()) {
System.load(libFile.getAbsolutePath());
libLoaded = true;
}
}
}
catch (Throwable t) {