Java Library Load loadSystemLibrary(String library)

Here you can find the source of loadSystemLibrary(String library)

Description

Checks for the presence of a system library (.dll or .so file) by attempting to load it.

License

BSD License

Declaration

public static void loadSystemLibrary(String library) throws UnsatisfiedLinkError 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.io.File;

public class Main {
    /**/*from w w  w  .  jav  a2 s  .c o  m*/
     * Checks for the presence of a system library (.dll or .so file) by attempting
     * to load it.
     *
     * throws UnsatisfiedLinkError  If the system library could not be found.
     */
    public static void loadSystemLibrary(String library) throws UnsatisfiedLinkError {
        File libraryFile = new File(library);
        if (libraryFile.isAbsolute()) {
            System.load(library);
        } else {
            System.loadLibrary(library);
        }
    }
}

Related

  1. loadLibrary(String filename, String targetLibFolder)
  2. loadSystemLibrary(String filename)