Skip to content

Commit 6fc3359

Browse files
committed
Problem: [JNI] Errors loading libs on Android are not caught
Solution: Move the try catch block around the load library call for android as well
1 parent ee14f96 commit 6fc3359

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

zproject_java.gsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,14 +773,14 @@ public class ZmqNativeLoader {
773773

774774
public static void loadLibrary(String libname) {
775775
if (!loadedLibraries.contains(libname)) {
776-
if (System.getProperty("java.vm.vendor").contains("Android")) {
777-
System.loadLibrary(libname);
778-
} else {
779-
try {
776+
try {
777+
if (System.getProperty("java.vm.vendor").contains("Android")) {
778+
System.loadLibrary(libname);
779+
} else {
780780
NativeLoader.loadLibrary(libname);
781-
} catch (Exception e) {
782-
System.err.println("[WARN] " + e.getMessage() +" from jar. Assuming it is installed on the system.");
783781
}
782+
} catch (Exception e) {
783+
System.err.println("[WARN] " + e.getMessage() +" from jar. Assuming it is installed on the system.");
784784
}
785785
loadedLibraries.add(libname);
786786
}

0 commit comments

Comments
 (0)