Open ivucica opened 3 years ago
Hey @ivucica! I'm sorry it took so long. Thank you for your explanations. In case you are still interested: I updated JavaFX and added the macOS backup path. You can now set custom paths using the preferences, too. Finally, I published a release that you can download here: https://github.com/MaxiHuHe04/iTunes-Backup-Explorer/releases/latest. The jar should also work on macOS, but I didn't have a chance to test it yet. If you want to try it and it doesn't work, please let me know.
If anyone else is looking how to get this to run on aarch64 and is encountering
java.lang.UnsatisfiedLinkError: Can't load library: /Users/user/.openjfx/cache/18+12/libprism_sw.dylib
or
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
The problem is OpenJDK. To get it to work, I uninstalled OpenJDK, installed Oracle JDK 19 aarch64 and set JAVA_HOME, changed dependencies in the pom.xml from 18
to the latest builds of JavaFX packages 20-ea+7
and remove the platform tag/duplicates (probably not necessary). I then compiled this project mvn clean; mvn compile
and ran it mvn exec:exec
. It's important that everything is run natively aarch64 and not under Rosetta. Took about 3 hours to figure this out 😄 Once you're done you can uninstall evil Oracle JDK and go back to OpenJDK.
@claudiosv. Thanks for the guide. For those of us, not so knowledgeable on Java, programming or compiling, would you care to detail further your instructions?
If anyone else is looking how to get this to run on aarch64 and is encountering
java.lang.UnsatisfiedLinkError: Can't load library: /Users/user/.openjfx/cache/18+12/libprism_sw.dylib
or
Error initializing QuantumRenderer: no suitable pipeline found java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
The problem is OpenJDK. To get it to work, I uninstalled OpenJDK, installed Oracle JDK 19 aarch64 and set JAVA_HOME, changed dependencies in the pom.xml from
18
to the latest builds of JavaFX packages20-ea+7
and remove the platform tag/duplicates (probably not necessary). I then compiled this projectmvn clean; mvn compile
and ran itmvn exec:exec
. It's important that everything is run natively aarch64 and not under Rosetta. Took about 3 hours to figure this out 😄 Once you're done you can uninstall evil Oracle JDK and go back to OpenJDK.
Thanks for the guide. How to get the JavaFX package version (20-ea+7
doesn't seem to work with the latest JDK 19 downloaded from Oracle.)
@ccsasuke
I'm not a java developer, so I have no clue if these steps are strictly necessary, but what I did to get it working is as follows:
rm -rf ~/.m2/repository
)pom.xml
file, removing the javafx-graphics
entries for the other platforms, and specifying mac-aarch64
for all of the javafx entries.mvn clean; mvn compile
mvn exec:exec
This is all in addition to what the previous commenters suggested.
@danem This works, thanks!
If anyone else is looking how to get this to run on aarch64 and is encountering
java.lang.UnsatisfiedLinkError: Can't load library: /Users/user/.openjfx/cache/18+12/libprism_sw.dylib
or
Error initializing QuantumRenderer: no suitable pipeline found java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
The problem is OpenJDK. To get it to work, I uninstalled OpenJDK, installed Oracle JDK 19 aarch64 and set JAVA_HOME, changed dependencies in the pom.xml from
18
to the latest builds of JavaFX packages20-ea+7
and remove the platform tag/duplicates (probably not necessary). I then compiled this projectmvn clean; mvn compile
and ran itmvn exec:exec
. It's important that everything is run natively aarch64 and not under Rosetta. Took about 3 hours to figure this out 😄 Once you're done you can uninstall evil Oracle JDK and go back to OpenJDK.
I did not have to go through all of these steps, but changing the JDK definitely fixed the issue. Thank you sir!
Hi,
As someone that's not comfortable with Java, after a bit of effort, I managed to run iTunes Backup Explorer on OS X.
While I won't grab the time to put effort into a coherent PR, here's some things (a mixture of instructions for Mac OS users with some small patches):
I had Java 8 installed; I believe it was some sort of "system" Java. Not sure if it was the old Apple-provided build. I needed to bump Java to something newer. As I have Homebrew installed, I used:
This installed OpenJDK 17.
Per instructions printed by Homebrew, I exposed this to Apple's wrappers like so:
I'm not sure if I had to
export JAVA_HOME=$(/usr/libexec/java_home -v17)
.I had Maven installed from before. It was a Homebrew version (
brew install maven
).At this point I could build iTunes-Backup-Explorer using
mvn compile
.java -jar target/itunes-backup-explorer-1.0-SNAPSHOT.jar
did not work, butmvn javafx:run
did.JavaFX 13 has bugs on MacOS Catalina+. https://bugs.openjdk.java.net/browse/JDK-8234916
I've switched
javafx-controls
andjavafx-fxml
to version 15 in pom.xmlThis fixes the UI and now it renders correctly.
I had to run this from Terminal.app or iTerm.app which has been first allowlisted in System Preferences's Security & Privacy pane for "Full Disk Access" -- otherwise I could not
ls ~/Library/Application Support/MobileSync/Backup
, and neither could it be accessed by iTunes-Backup-Explorer.By allowlisting the terminal app,
java
process inherits these permissions.There is likely an API to request full disk access, but I have not done serious Cocoa work in years, and definitely not in Java.
Unfortunately, the code also hardcodes the path to
MobileSync/Backup
toSystem.getenv("APPDATA"), "Apple Computer\\MobileSync\\Backup"
.This is easy to resolve with
System.getenv("HOME"), "Library/Application Support/MobileSync/Backup"
.Even though that's technically incorrect: one should use
+[NSFileManager URLForDirectory:inDomains:]
to find the paths toNSApplicationSupportDirectory
inNSUserDomainMask
orNSAllDomainsMask
-- accepting there can be more than one such directory. Now, how to do that in Java? I don't really know.Of course, this is very much a Mac-specific code change, meaning it should be isolated from other supported OSes, so in lieu of spending time figuring that out, I'm just writing this issue and going back to recovering my Safari tabs :-)