Package ch.ntb.usb

Class LibLoader

java.lang.Object
ch.ntb.usb.LibLoader

public class LibLoader extends Object
This class allows to load libraries in the normal way or as a system resource (e.g. form the current .jar file). See below for a further description.
  • Constructor Details

    • LibLoader

      public LibLoader()
  • Method Details

    • load

      public static void load(String libName)
      Loads a library. This is done in three steps.
      1. The library is tried to be load from the path list specified by the java.library.path property.
      2. The library is tried to be load from the current directory.
      3. The library is searched as a system resource (e.g. in the current .jar file), copied to to temporary directory and loaded from there. Afterwards the temporary library is deleted. The copying is necessary because libraries can't be loaded directly from .jar files.
      Parameters:
      libName - Library name (e.g. usbJava)
      Throws:
      UnsatisfiedLinkError