Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from bluca/regen
Problem: missing files from last regen
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
bindings/jni/src/main/java/org/zeromq/tools/ZmqNativeLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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); | |||
} | |||
} | |||
|
|||
} |