SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mac OS X can't find libfuse.dylib

stanimirivanovde opened this issue · comments

Hey, I just encountered an error where jnr-fuse will refuse to mount a volume with "Image not found" unsatisfied link error. I looked into it and thought it is due to the fact they changed osxfuse to macfuse. But looking at it further pointed to the path being an issue. If I add the following line before mounting, then everything works:

System.setProperty("java.library.path", "/usr/local/lib/");

The library is installed correctly, and the kernel extension is loaded etc. I'm not sure if this is just me but I'm running on a new 16" Macbook Pro with latest Big Sur update.

I looked at your code and saw that you're not passing absolute paths but rather the lib name:

private static final String[] osxFuseLibraries = {"fuse4x", "osxfuse", "macfuse", "fuse"};

Not sure if it makes sense for me to do a pull request since this can be worked around with the line of code I posted above.

Hey, @stanimirivanovde!

Thanks for reporting! The path is included now by default for MacOS:

libFuse = LibraryLoader.create(LibFuse.class)
.failImmediately()
// adds user library search path which is not included by default
.search("/usr/local/lib/")
.load(library);