Skip to content

Commit

Permalink
Merge pull request #634 from bluca/regen
Browse files Browse the repository at this point in the history
Problem: missing files from last regen
  • Loading branch information
sappo committed May 31, 2019
2 parents c272f59 + 4ec03c4 commit 8c64fe1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bindings/jni/src/main/java/org/zeromq/tools/ZmqNativeLoader.java
@@ -0,0 +1,26 @@
package org.zeromq.tools;

import java.util.Set;
import java.util.HashSet;
import org.scijava.nativelib.NativeLoader;

public class ZmqNativeLoader {

private static final Set<String> loadedLibraries = new HashSet<>();

public static void loadLibrary(String libname) {
if (!loadedLibraries.contains(libname)) {
if (System.getProperty("java.vm.vendor").contains("Android")) {
System.loadLibrary(libname);
} else {
try {
NativeLoader.loadLibrary(libname);
} catch (Exception e) {
System.err.println("[WARN] " + e.getMessage() +" from jar. Assuming it is installed on the system.");
}
}
loadedLibraries.add(libname);
}
}

}

0 comments on commit 8c64fe1

Please sign in to comment.