I have a mature Java app built for windows, mac, and ubuntu. In Windows it piggy backs on AVRDude to upload pre-built firmware. I'd like to offer something similar for all my mac users. The path to getting mac avrdude installed seems quite onerous, and I haven't found a purely-java way to upload hex files.
Clearly Arduino has already solved this problem - in fact, I used Arduino as an example when figuring out how to do the avrdude thing. So... can you please give me some pointers? I'm trying to make things simpler for my users so they can't install 3rd party stuff, open the CLI, any of that. I can add things to the DMG file when I package with maven.
I'm not sure if I understand your goal. Arduino didn't implement a system for uploading hex files in the Java code. Arduino IDE and Arduino CLI only generate an upload command from the pattern (a template) defined in the platform of the selected board and then invokes that arbitrary command. The upload tool like AVRDUDE handles the actual upload.
I edited the paths slight to reduce the verbosity.
Oh, I should have added that if you really wanted to port it to Java, you can find the avrdude source online - I don't know how up to date it is, or what the licensing issues might be, but that would be an option.
If it were me, I would just include an installation of avrdude in your project and just run that - just like the Arduino installer seems to do.
Well... I guess I'm just stuck on the idea of making my users install a lot of stuff just to run one feature, doesn't feel efficient or safe. Yes, I can figure out how to make the packaging tool run those commands to install some app to then install avrdude and pray none of the middle steps break. I remain hopeful there's a way with less steps.
investigating further... I use jpackage to prepare my app for release and it's my understanding that it is not well equipped to call out to install homebrew etc.