|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.scijava.nativelib.NativeLibraryUtil
public class NativeLibraryUtil
This class is a utility for loading native libraries.
Native libraries should be packaged into a single jar file, with the following directory & file structure:
META_INF lib linux_32 libxxx[-vvv].so linux_64 libxxx[-vvv].so osx_32 libxxx[-vvv].dylib osx_64 libxxx[-vvv].dylib windows_32 xxx[-vvv].dll windows_64 xxx[-vvv].dll
Here "xxx" is the name of the native library and "-vvv" is an optional version number.
Current approach is to unpack the native library into a temporary file and load from there.
| Nested Class Summary | |
|---|---|
static class |
NativeLibraryUtil.Architecture
|
| Constructor Summary | |
|---|---|
NativeLibraryUtil()
|
|
| Method Summary | |
|---|---|
static NativeLibraryUtil.Architecture |
getArchitecture()
Determines the underlying hardware platform and architecture. |
static String |
getPlatformLibraryName(String libName)
Returns the full file name (without path) of the native library. |
static String |
getPlatformLibraryPath()
Returns the path to the native library. |
static String |
getVersionedLibraryName(Class libraryJarClass,
String libName)
Returns the Maven-versioned file name of the native library. |
static boolean |
loadNativeLibrary(Class libraryJarClass,
String libName)
Loads the native library. |
static boolean |
loadVersionedNativeLibrary(Class libraryJarClass,
String libName)
Loads the native library. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NativeLibraryUtil()
| Method Detail |
|---|
public static NativeLibraryUtil.Architecture getArchitecture()
public static String getPlatformLibraryPath()
public static String getPlatformLibraryName(String libName)
libName -
public static String getVersionedLibraryName(Class libraryJarClass,
String libName)
libName -
public static boolean loadVersionedNativeLibrary(Class libraryJarClass,
String libName)
libraryJarClass - any class within the library-containing jarlibName - name of library
public static boolean loadNativeLibrary(Class libraryJarClass,
String libName)
libraryJarClass - any class within the library-containing jarlibName - name of library
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||