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

macOS 11.0: java.lang.NoClassDefFoundError: Could not initialize class purejavahidapi.PureJavaHidApi #75

Open
tresf opened this issue Jun 30, 2020 · 2 comments

Comments

@tresf
Copy link

tresf commented Jun 30, 2020

java.lang.UnsatisfiedLinkError: Unable to load library 'CoreFoundation': Native library (darwin/libCoreFoundation.dylib) not found in resource path

PureJavaHIDAPI has a compatibility issue with macOS 11.0 "Big Sur". Quoting a Reddit article:

Is CoreFoundation missing for everyone on Big Sur?

...

"Dynamic libraries that are included in the OS are no longer present in the file system and can only be found by trying to open them with dlopen()."

Quoting Apple:

  • New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for a library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

Reviewing the source, I believe the source of the problem is in CoreFoundationLibrary.java's call to loadLibrary(). This call has been changed on master branch to use load() instead: 4150a3d#diff-f53dda5da8ac7d05fef6b86343d66ab9L14

If this issue is fixed in master, please accept my apologies for a redundant bug report but since macOS 11.0 Big Sur is still in beta, information on this is hard to find and I hope for it to help others.

Edit: I also realize that this bug may be related to JNA. I would be happy to file an upstream bug report if that's deemed as the cause.

@nyholku
Copy link
Owner

nyholku commented Jul 1, 2020 via email

@casiez
Copy link

casiez commented Jun 3, 2021

I had the same problem on Big Sur using jna-4.0.0.jar
Problem was solved after using jna-5.8.0.jar

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

3 participants