Package ch.ntb.usb

Class LibLoader


  • public class LibLoader
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      LibLoader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void load​(java.lang.String libName)
      Loads a library.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LibLoader

        public LibLoader()
    • Method Detail

      • load

        public static void load​(java.lang.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:
        java.lang.UnsatisfiedLinkError