Can't load library libprism_es2.dylib
BE-CH opened this issue ยท 6 comments
Thank you for this amazing project!
When I am trying to launch the program with the configuration below, I get a few errors.
Using the latest iTunes Backup Explorer v1.4
My configuration
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Homebrew (build 19.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.2, mixed mode, sharing)
Chip: Apple M1 Pro
Memory: 16 GB
macOS: 13.5.2 (22G91)
The errors
java -jar itunes-backup-explorer-1.4.jar
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: Can't load library: /Users/bech/.openjfx/cache/18+12/libprism_es2.dylib
java.lang.UnsatisfiedLinkError: Can't load library: /Users/bech/.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/bech/.openjfx/cache/18+12/libprism_sw.dylib
java.lang.UnsatisfiedLinkError: Can't load library: /Users/bech/.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
Hey, I sadly don't have a device with an M1/M2, so I can't test solutions for this issue.
But for others, it helped installing the Azul Zulu JDK with JavaFX for macOS. You can download it from here: https://www.azul.com/downloads/?version=java-21-lts&os=macos&architecture=arm-64-bit&package=jdk-fx#zulu.
Using Azul Zulu JDK worked for me on my M2. Thanks for the hard work developing this!
I can confirm, that Azul Zulu JDK works on M1 as well.
I am on an M1 Mac, and I got the same error. I was able to get this working with Oracle's Java and JavaFX when starting with the following command.
java --module-path /Users/.../javafx-sdk-21/lib --add-modules
javafx.controls,javafx.fxml -jar itunes-backup-explorer-1.4.jar
JavaFX can be downloaded here. Just extract and make sure the path matches in the launch command.
I switched to the Azure java version but I'm still getting this error:
โ ~ java --version
openjdk 21.0.4 2024-07-16 LTS
OpenJDK Runtime Environment Zulu21.36+17-CA (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Zulu21.36+17-CA (build 21.0.4+7-LTS, mixed mode, sharing)
โ ~ cd Downloads
โ Downloads java -jar itunes-backup-explorer-1.5.jar
Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/<username>/.openjfx/cache/22+30/aarch64/libprism_es2.dylib: dlopen(/Users/<username>/.openjfx/cache/22+30/aarch64/libprism_es2.dylib, 0x0001): tried: '/Users/<username>/.openjfx/cache/22+30/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/<username>/.openjfx/cache/22+30/aarch64/libprism_es2.dylib' (no such file), '/Users/<username>/.openjfx/cache/22+30/aarch64/libprism_es2.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
@Joelasaur did you download Zulu for the right architecture (arm64)?
Do you have another Java version installed at the same time?