Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundled sodium.dll cannot be loaded when path to JAR contains spaces #120

Open
tomwetjens opened this issue Aug 4, 2022 · 1 comment
Open

Comments

@tomwetjens
Copy link

When running LazySodium on Windows, the bundled sodium.dll cannot be loaded when the path to the lazysodium JAR file contains spaces:

Native library (win32-x86-64/sodium.dll) not found in resource path (C:\Users\Tom Wetjens\.m2\repository\org\junit\platform\junit-platform-launcher\1.8.2\junit-platform-launcher-1.8.2.jar;...<cut long output>.
09:22:46.738 [main] DEBUG ResourceLoader - This is not a JAR file due to C:\Users\Tom%20Wetjens\.m2\repository\com\goterl\lazysodium-java\5.1.1\lazysodium-java-5.1.1.jar

java.nio.file.FileSystemNotFoundException
	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:156)
	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:142)
	at java.base/java.nio.file.Path.of(Path.java:208)
	at java.base/java.nio.file.Paths.get(Paths.java:98)
	at com.goterl.resourceloader.ResourceLoader.getFileFromFileSystem(ResourceLoader.java:237)
	at com.goterl.resourceloader.ResourceLoader.copyToTempDirectory(ResourceLoader.java:88)
	at com.goterl.resourceloader.SharedLibraryLoader.load(SharedLibraryLoader.java:53)
	at com.goterl.lazysodium.utils.LibraryLoader.loadBundledLibrary(LibraryLoader.java:134)
	at com.goterl.lazysodium.utils.LibraryLoader.loadLibrary(LibraryLoader.java:95)
	at com.goterl.lazysodium.SodiumJava.<init>(SodiumJava.java:34)
	at com.goterl.lazysodium.SodiumJava.<init>(SodiumJava.java:23)

After changing the local Maven repository to a path without spaces e.g. C:\maven\repository, loading of the bundled sodium.dll works fine.

It would be nice if it works on all platforms, regardless of spaces in the path.

@tomwetjens
Copy link
Author

Seems to be caused by terl/resource-loader#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant