public static void loadNativeLibrary(String name, boolean isRequired) {
        if (JmeSystem.isLowPermissions()) {
            throw new UnsupportedOperationException("JVM is running under "
                    + "reduced permissions. Cannot load native libraries.");
        }

        Platform platform = JmeSystem.getPlatform();
        NativeLibrary library = nativeLibraryMap.get(new NativeLibrary.Key(name, platform));
        
        if (library == null) {
            // No library exists for this platform.
            if (isRequired) {
                throw new UnsatisfiedLinkError(
                        "The required native library '" + name + "'"
                        + " is not available for your OS: " + platform);
            } else {
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "The optional native library ''{0}''" +
                                    " is not available for your OS: {1}",
                            new Object[]{name, platform});
                }
                return;
            }
        }
        
        final String pathInJar = library.getPathInNativesJar();

        if (pathInJar == null) {
            // This platform does not require the native library to be loaded.
            return;
        }

        URL url = Resources.getResource(pathInJar);

        if (url == null) {
            if (isRequired) {
                throw new UnsatisfiedLinkError(
                        "The required native library '" + library.getName() + "'"
                                + " was not found in the classpath via '" + pathInJar);
            } else if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE, "The optional native library ''{0}''" +
                                " was not found in the classpath via ''{1}''.",
                        new Object[]{library.getName(), pathInJar});
            }
            return;
        }
        
        // The library has been found and is ready to be extracted.
        // Determine what filename it should be extracted as.
        String loadedAsFileName;
        if (library.getExtractedAsName() != null) {
            loadedAsFileName = library.getExtractedAsName();
        } else {
            // Just use the original filename as it is in the JAR.
            loadedAsFileName = Paths.get(pathInJar).getFileName().toString();
        }
        
        File extractionDirectory = getExtractionFolder();
        URLConnection conn;

        try {
            conn = url.openConnection();
        } catch (IOException ex) {
            // Maybe put more detail here? Not sure.
            throw new UncheckedIOException("Failed to open file: '" + url + 
                                           "'. Error: " + ex, ex);
        }
        
        File targetFile = new File(extractionDirectory, loadedAsFileName);
        try (InputStream in = conn.getInputStream()) {
            if (isExtractingRequired(conn, targetFile)) {
                Files.copy(in, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING);

                // NOTE: On OSes that support "Date Created" property,
                // this will cause the last modified date to be lower than
                // date created which makes no sense
                targetFile.setLastModified(conn.getLastModified());

                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "Extracted native library from ''{0}'' into ''{1}''. ",
                            new Object[]{url, targetFile});
                }
            } else {
                if (logger.isLoggable(Level.FINE)) {
                    logger.log(Level.FINE, "Not copying library {0}. Latest already extracted.",
                            loadedAsFileName);
                }
            }

            library.getLoadFunction().accept(targetFile.getAbsolutePath());

            if (logger.isLoggable(Level.FINE)) {
                logger.log(Level.FINE, "Loaded native library {0}.", library.getName());
            }
        } catch (IOException ex) {
            /*if (ex.getMessage().contains("used by another process")) {
                return;
            }*/

            throw new UncheckedIOException("Failed to extract native library to: "
                    + targetFile, ex);
        }
    }
First extracts the native library and then loads it.

@param name The name of the library to load.
@param isRequired If true and the library fails to load, throw exception. If
false, do nothing if it fails to load.
jme3-desktop/src/main/java/com/jme3/system/NativeLibraryLoader.java