(SIGAR-141) sigar.jar location is not required to find native library
This commit is contained in:
parent
6d6b5577b1
commit
68cf08cf4d
|
@ -250,6 +250,11 @@ public class ArchLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String findJarPath(String libName)
|
public String findJarPath(String libName)
|
||||||
|
throws ArchLoaderException {
|
||||||
|
return findJarPath(libName, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String findJarPath(String libName, boolean isRequired)
|
||||||
throws ArchLoaderException {
|
throws ArchLoaderException {
|
||||||
/*
|
/*
|
||||||
* native libraries should be installed along side
|
* native libraries should be installed along side
|
||||||
|
@ -280,8 +285,13 @@ public class ArchLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
throw new ArchLoaderException("Unable to find " +
|
if (isRequired) {
|
||||||
getJarName());
|
throw new ArchLoaderException("Unable to find " +
|
||||||
|
getJarName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path = url.getFile();
|
path = url.getFile();
|
||||||
|
@ -385,11 +395,11 @@ public class ArchLoader {
|
||||||
if (path.equals("-")) {
|
if (path.equals("-")) {
|
||||||
return; //assume library is already loaded
|
return; //assume library is already loaded
|
||||||
}
|
}
|
||||||
findJarPath(null); //check for versioned .jar
|
findJarPath(null, false); //check for versioned .jar
|
||||||
findNativeLibrary(path, libName);
|
findNativeLibrary(path, libName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (findJarPath(libName) == null) {
|
if (findJarPath(libName, false) == null) {
|
||||||
findInJavaLibraryPath(libName);
|
findInJavaLibraryPath(libName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue