code: private static void loadLibraryResource(
          String resourceSubdirectoryName,
          String libraryName,
          String tempSubdirectoryName,
          String ... dependentLibraryNames) throws Throwable
      {
          // First try to load all dependent libraries, recursively
          for (String dependentLibraryName : dependentLibraryNames)
          {
              logger.log(level, 
                  "Library " + libraryName + 
                  " depends on " + dependentLibraryName);
              
              String dependentResourceSubdirectoryName =
                  resourceSubdirectoryName + "/" + 
                  osString() + "/" + 
                  archString();
  
              String dependentLibraryTempSubDirectoryName =
                  libraryName + "_dependents" + File.separator + 
                  osString() + File.separator +
                  archString() + File.separator;
              
              loadLibraryResource(
                  dependentResourceSubdirectoryName,
                  dependentLibraryName, 
                  dependentLibraryTempSubDirectoryName);
          }
          
          // Now, prepare loading the actual library
          String libraryFileName = createLibraryFileName(libraryName);
          File libraryTempFile = createTempFile(
                  tempSubdirectoryName, libraryFileName);
          
          // If the temporary file for the library does not exist, create it
          if (!libraryTempFile.exists())
          {
              String libraryResourceName = 
                  resourceSubdirectoryName + "/" + libraryFileName;
              logger.log(level, 
                  "Writing resource  " + libraryResourceName);
              logger.log(level, 
                  "to temporary file " + libraryTempFile);
              writeResourceToFile(libraryResourceName, libraryTempFile);
          }
          
          // Finally, try to load the library from the temporary file
          logger.log(level, "Loading library " + libraryTempFile);
          System.load(libraryTempFile.toString());
          logger.log(level, "Loading library " + libraryTempFile + " DONE");
      }
docs: Load the library with the given name from a resource.
  
  @param resourceSubdirectoryName The subdirectory where the resource
  is expected
  @param libraryName The library name, e.g. "EXAMPLE-windows-x86"
  @param tempSubdirectoryName The name for the subdirectory in the
  temp directory, where the temporary files for dependent libraries
  should be stored
  @param dependentLibraryNames The names of libraries that the library
  to load depends on, and that may have to be loaded as resources and
  stored as temporary files as well
  @throws Throwable If the library could not be loaded