Skip to content
New issue

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

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

Already on GitHub? # to your account

Java UnsatisfiedLinkError - is there a solution for Apple Silicon?? #12

Open
cachatj opened this issue Oct 15, 2023 · 4 comments
Open

Comments

@cachatj
Copy link

cachatj commented Oct 15, 2023

java.lang.UnsatisfiedLinkError: Can't load library: /var/folders/ft/r2l5xjqn2dz_x4n3k0h7f6vc0000gq/T/jogamp_0000/file_cache/jln2972385321995133681/jln6713280780942712952/natives/macosx-universal/libgluegen_rt.dylib

Java(TM) SE Runtime Environment (build 17.0.8+9-LTS-211)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.8+9-LTS-211, mixed mode, sharing)

launching DynamoVis with:

java --add-exports java.desktop/com.apple.eawt=ALL-UNNAMED -jar DynamoVis.jar

Any insights?

@merttoka
Copy link
Member

I don't have access to a machine with Apple silicon, but ChatGPT gave the following response based on your error messages (4th option might be the most helpful):

"The error you're seeing is an UnsatisfiedLinkError, which indicates that the Java Virtual Machine (JVM) can't find a native library it needs to run your Java application. Specifically, it's trying to load a dynamic link library (.dylib) which is not present or not compatible.

Considering the details provided and the fact that this is happening on Apple silicon (presumably the M1 chip or its successors), here are a few general steps and considerations to resolve the issue:

  1. Native Library Compatibility: Ensure that the native library (libgluegen_rt.dylib in this case) is compatible with Apple silicon. Many native libraries were initially built for Intel-based Macs, and they might not work out-of-the-box on Apple's new ARM-based architecture.

  2. Java Version: Ensure you're using a version of Java that's compatible with Apple silicon. The provided information shows you're using Java 17, which should have support. However, make sure you downloaded the ARM64 version and not the x86_64 version. You might consider using a distribution like AdoptOpenJDK or Zulu which provides explicit ARM64 builds.

  3. JAVA_LIBRARY_PATH: You might need to set the JAVA_LIBRARY_PATH environment variable to point to the directory containing the .dylib files your application needs.

    export JAVA_LIBRARY_PATH=/path/to/your/dylib/directory
    

    After setting this, try rerunning your Java application.

  4. Use Rosetta: As a temporary solution, you can use Apple's Rosetta 2 to run your application under x86_64 emulation. This might have performance penalties, but it can be a helpful stopgap solution until native libraries are updated. You can start a terminal under Rosetta by opening Terminal, navigating to Applications > Utilities, duplicating the Terminal app, and then right-clicking on the duplicate and selecting "Get Info" and then "Open using Rosetta". Then, run your Java application from that terminal instance.

  5. Recompile Native Libraries: If you have access to the source code of the native libraries, you might need to recompile them for Apple silicon."

@sonofahutmaker
Copy link
Contributor

Hey @cachatj, I'm running DynamoVis on Apple silicon and it's working fine for me with the same command. Were you able to resolve or are you still facing this?

@cachatj
Copy link
Author

cachatj commented Oct 18, 2023 via email

@gef06
Copy link

gef06 commented Oct 6, 2024

Hi @sonofahutmaker wondering if you had any tips for running DynamoVis on Apple silicon. Have JDK 23 (ARM64 version) installed and set up in path. DynamoVis opens fine and can load in data, but once I click animate, the control panel pops up but no animation screen. No errors thrown, so not sure where to start! Hoping there's a simple step I've missed

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

No branches or pull requests

4 participants