Skip to content

Commit 29a4007

Browse files
committed
Try loading binaries from library path
1 parent 1cc14ff commit 29a4007

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

client-jvm/src/main/java/com/etebase/client/internal/NativeLoader.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,22 @@ public static void load() {
2424
String override = System.getProperty(OVERRIDE_PROPERTY);
2525
if (override != null && !override.isEmpty()) {
2626
System.load(override);
27-
} else {
27+
} else if (!loadFromLibraryPath()) {
2828
loadFromClasspath();
2929
}
3030
loaded = true;
3131
}
3232
}
3333

34+
private static boolean loadFromLibraryPath() {
35+
try {
36+
System.loadLibrary(LIB_NAME);
37+
return true;
38+
} catch (UnsatisfiedLinkError ignored) {
39+
return false;
40+
}
41+
}
42+
3443
private static void loadFromClasspath() {
3544
String os = detectOs();
3645
String arch = detectArch();

0 commit comments

Comments
 (0)