NativeLoader: $(CWD)/native/... als Ladequelle hinzugefügt
parent
723e515970
commit
2b82d4e021
|
@ -34,6 +34,12 @@ public class NativeLoader {
|
|||
public static String nativeResourceName(String libName){
|
||||
return String.format("/native/%s/%s", Platform.PlatformName(), nativeLibraryName(libName));
|
||||
}
|
||||
|
||||
public static String nativeLocalResourceName(String libName){
|
||||
return String.format("native%s%s%s%s", File.separator, Platform.PlatformName(), File.separator, nativeLibraryName(libName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* loadLibrary()
|
||||
|
@ -68,6 +74,18 @@ public class NativeLoader {
|
|||
{
|
||||
System.err.println(String.format("NativeLoader.loadLibrary(): System.load('%s') erfolglos",libFileName));
|
||||
};
|
||||
|
||||
String nativeLocalResourceName = new File("").getAbsolutePath() + File.separator + nativeLocalResourceName(libName);
|
||||
try
|
||||
{
|
||||
System.load(nativeLocalResourceName);
|
||||
System.out.println(String.format("NativeLoader.loadLibrary(): System.load('%s') erfolgreich",nativeLocalResourceName));
|
||||
return;
|
||||
} catch (UnsatisfiedLinkError e)
|
||||
{
|
||||
System.err.println(String.format("NativeLoader.loadLibrary(): System.load('%s') erfolglos",nativeLocalResourceName));
|
||||
};
|
||||
|
||||
|
||||
String nativeResourceName = nativeResourceName(libName);
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue