Java Utililty Methods Library Load

List of utility methods to do Library Load

Description

The list of methods to do Library Load are organized into topic(s).

Method

booleanloadLibrary(String filename, String targetLibFolder)
Load the JNI library directly by using the file name
try {
    System.load(targetLibFolder + File.separator + filename);
    return true;
} catch (Exception e) {
    return false;
booleanloadSystemLibrary(String filename)
Load the JNI library from the folder specified by java.library.path
try {
    System.loadLibrary(filename);
    return true;
} catch (Exception e) {
    return false;
voidloadSystemLibrary(String library)
Checks for the presence of a system library (.dll or .so file) by attempting to load it.
File libraryFile = new File(library);
if (libraryFile.isAbsolute()) {
    System.load(library);
} else {
    System.loadLibrary(library);