I designed an application with JavaFX/scenebuilder that connects to an arduino. The application has an option to update the Arduino with AVRdude. It does so by running a bat file with a command that executes AVRdude with a HEX file in a certain path. The user should be able to select a hex file, how would I go about realizing this?
The command is structured like: [config file] [parameters] -Uflash:w:[user selected hex file]:i
Where [user selected hex file] should be replaced by the path that the system gets from the filechooser.
I tried to put the command into a bat file and run it with Runtime.exec and Processbuilder but I can only get it working with a fixed command/path.
What would be the best way to run the command with the path as a variable? The filechooser code already works, its just how to inject the variable into the command.