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

java.lang.UnsatisfiedLinkError: Can't load library: libprism_es2.dylib #10

Open
kennymc-c opened this issue Nov 4, 2022 · 5 comments
Open

Comments

@kennymc-c
Copy link

When I try to load the program via java -jar itunes-backup-explorer-1.2.jar, I get the following error on a M1 Pro MacBook Pro with macOS Ventura 13.0:

java.lang.UnsatisfiedLinkError: Can't load library: /Users/username/.openjfx/cache/18+12/libprism_es2.dylib
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408)
	at java.base/java.lang.Runtime.load0(Runtime.java:785)
	at java.base/java.lang.System.load(System.java:2011)
	at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
	at com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:63)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:52)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:390)
	at java.base/java.lang.Class.forName(Class.java:381)
	at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/username/.openjfx/cache/18+12/libprism_sw.dylib
java.lang.UnsatisfiedLinkError: Can't load library: /Users/username/.openjfx/cache/18+12/libprism_sw.dylib
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2408)
	at java.base/java.lang.Runtime.load0(Runtime.java:785)
	at java.base/java.lang.System.load(System.java:2011)
	at com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:217)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:197)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:138)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
	at com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:43)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at com.sun.prism.sw.SWPipeline.<clinit>(SWPipeline.java:42)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:390)
	at java.base/java.lang.Class.forName(Class.java:381)
	at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
	at javafx.scene.image.Image.loadImage(Image.java:1081)
	at javafx.scene.image.Image.initialize(Image.java:816)
	at javafx.scene.image.Image.<init>(Image.java:706)
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.getIcon(ITunesBackupExplorer.java:43)
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.<clinit>(ITunesBackupExplorer.java:46)
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorerLauncher.main(ITunesBackupExplorerLauncher.java:6)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Exception in thread "main" java.lang.ExceptionInInitializerError
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorerLauncher.main(ITunesBackupExplorerLauncher.java:6)
Caused by: java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:278)
	at javafx.scene.image.Image.loadImage(Image.java:1081)
	at javafx.scene.image.Image.initialize(Image.java:816)
	at javafx.scene.image.Image.<init>(Image.java:706)
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.getIcon(ITunesBackupExplorer.java:43)
	at me.maxih.itunes_backup_explorer.ITunesBackupExplorer.<clinit>(ITunesBackupExplorer.java:46)
	... 1 more```

Similar to what is described here, the program seems to download the wrong architecture for JavaFX: openjfx/javafx-gradle-plugin#112

@claudiosv
Copy link

claudiosv commented Nov 24, 2022

@kennymc-c Not sure if you're still interested in getting this to work, I had the same issue, resolved it here #3 (comment)

@zzph
Copy link

zzph commented Feb 9, 2023

I'm also having this issue- the solution linked above is pretty technical and I don't understand how to do it.

Has anyone found a solution?

@ankit-vs
Copy link

ankit-vs commented May 23, 2023

This issue can be solved by installing JDK from the build of JDK 11 with JavaFX , as suggested in this answer https://stackoverflow.com/a/71622655/4523862 . [ NOTE : Follow the link in the answer, and SCROLL DOWN to find the download button for JDK 11 bundled with JavaFX ]

This tool Works!
This tool was my last hope to restore my iPhone backup, since IOS restore backup was failing to restore on my iPhone saying corrupted backup. (If anyone has solution to that too please let me know.)

@MaxiHuHe04
Copy link
Owner

@ankit-vs Thanks for the info!

I don't own a Mac so I haven't been able to test this yet. When I get the chance, I will try to really fix the issue and/or update the installation instruction for macOS. Maybe a separate jar for macOS/M1 could also help.

This tool was my last hope to restore my iPhone backup, which was failing to restore on my iPhone saying corrupted backup. (If anyone has solution to that too please let me know.)

Regarding this, with a bit of luck I may actually be able to help you. As this doesn't have anything to do with the original issue, can we move to #21?

@TkachenkoDmitry
Copy link

You need to have JavaFX, so either you add this module or use a distribution with pre-bundled JavaFX.

I've solved the issue by installing this distribution: https://www.azul.com/downloads/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jdk-fx#zulu

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

6 participants