code: public static void loadNativeLibrary(Logger logger)
      {
          synchronized(WindowsFaxClientSpiHelper.NATIVE_LOCK)
          {
              if(!WindowsFaxClientSpiHelper.nativeLibraryLoaded)
              {
                  try
                  {
                      //get temporary directory
                      File directory=IOHelper.getFax4jInternalTemporaryDirectory();
  
                      //get dll path
                      File dllFile=new File(directory,"fax4j.dll");
  
                      //get path
                      String path=dllFile.getPath();
  
                      //load native library
                      System.load(path);
                      logger.logDebug(new Object[]{"Loaded native library runtime path."},null);
                      
                      //set flag
                      WindowsFaxClientSpiHelper.nativeLibraryLoaded=true;
                  }
                  catch(Throwable throwable)
                  {
                      logger.logError(new Object[]{"Error while loading native library from runtime path."},throwable);
                  }
  
                  if(!WindowsFaxClientSpiHelper.nativeLibraryLoaded)
                  {
                      try
                      {
                          //load native library
                          System.loadLibrary("fax4j");
                          logger.logDebug(new Object[]{"Loaded native library from native path."},null);
                          
                          //set flag
                          WindowsFaxClientSpiHelper.nativeLibraryLoaded=true;
                      }
                      catch(Throwable throwable)
                      {
                          logger.logError(new Object[]{"Error while loading native library from native path."},throwable);
                      }
                  }
              }
          }
      }
docs: Loads the native library if not loaded before.
  
  @param   logger
  The logger