Example usage for java.lang System load

List of usage examples for java.lang System load

Introduction

In this page you can find the example usage for java.lang System load.

Prototype

@CallerSensitive
public static void load(String filename) 

Source Link

Document

Loads the native library specified by the filename argument.

Usage

From source file:com.sikulix.core.SX.java

static void loadNativeLibrary(String aLib) {
    try {//  w w w . j a  v  a  2  s  .c  o m
        if (aLib.startsWith("_ext_")) {
            error("loadNativeLibrary: loading external library not implemented: %s", aLib);
        } else {
            String sf_aLib = new File(getSXNATIVE(), aLib).getAbsolutePath();
            System.load(sf_aLib);
            debug("loadNativeLibrary: bundled: %s", aLib);
        }
    } catch (UnsatisfiedLinkError ex) {
        terminate(1, "loadNativeLibrary: loading library error: %s (%s)", aLib, ex.getMessage());
    }
}

From source file:JNLPAppletLauncher.java

/**
 * Method called by an extension such as JOGL or Java 3D to load the
 * specified library. Applications and applets should not call this method.
 *
 * @param libraryName name of the library to be loaded
 *
 * @throws SecurityException if the caller does not have permission to
 * call System.load// w  ww  . j av a2s.  com
 */
public static void loadLibrary(String libraryName) {
    if (VERBOSE) {
        System.err.println("-----------");
        Thread.dumpStack();
    }

    if (DEBUG) {
        System.err.println("JNLPAppletLauncher.loadLibrary(\"" + libraryName + "\")");
    }

    String fullLibraryName = (String) nativeLibMap.get(libraryName);
    if (fullLibraryName == null) {
        // Throw UnsatisfiedLinkError to try to match behavior of System.loadLibrary()
        throw new UnsatisfiedLinkError(libraryName);
    }

    if (DEBUG) {
        System.err.println("    loading: " + fullLibraryName + "");
    }

    System.load(fullLibraryName);
}