diff --git a/snaploader/src/main/java/electrostatic4j/snaploader/NativeBinaryLoader.java b/snaploader/src/main/java/electrostatic4j/snaploader/NativeBinaryLoader.java index 1ddc5c6..6bdf0d0 100644 --- a/snaploader/src/main/java/electrostatic4j/snaploader/NativeBinaryLoader.java +++ b/snaploader/src/main/java/electrostatic4j/snaploader/NativeBinaryLoader.java @@ -350,8 +350,10 @@ public void onExtractionFinalization(FileExtractor fileExtractor, FileLocator fi protected FileExtractor initializeLibraryExtractor(NativeDynamicLibrary library) throws Exception { FileExtractor extractor; if (library.getJarPath() != null) { + // use an extractor with the external jar routine extractor = new LibraryExtractor(new JarFile(library.getJarPath()), library.getCompressedLibrary(), library.getExtractedLibrary()); } else { + // use an extractor with the classpath routine extractor = new LibraryExtractor(library.getCompressedLibrary(), library.getExtractedLibrary()); } extractor.initialize(0); @@ -364,7 +366,7 @@ protected LibraryLocator preInitLibraryLocator(FileExtractor extractor) { extractor.getFileLocator().setFileLocalizingListener(new FileLocalizingListener() { @Override public void onFileLocalizationSuccess(FileLocator locator) { - SnapLoaderLogger.log(Level.INFO, getClass().getName(), "initializeLibraryExtractor", + SnapLoaderLogger.log(Level.INFO, getClass().getName(), "preInitLibraryLocator", "Locating native libraries has succeeded!"); // bind the library locator lifecycle to the user application @@ -375,7 +377,7 @@ public void onFileLocalizationSuccess(FileLocator locator) { @Override public void onFileLocalizationFailure(FileLocator locator, Throwable throwable) { - SnapLoaderLogger.log(Level.SEVERE, getClass().getName(), "initializeLibraryExtractor", + SnapLoaderLogger.log(Level.SEVERE, getClass().getName(), "preInitLibraryLocator", "Locating native libraries has failed!", throwable); try { extractor.close();