I need to execute a command from a program. The command line is ok, I tried it in the terminal, but it doesn\'t work in the program.
I add a copy from my code:
If you have Java 7, it's easier:
Process p = new ProcessBuilder()
.command("exiftool", "-a", "-u", "-g1", "-j",
new File("videos", filename).toString())
.redirectOutput(new File("metadata", filename + ".json"))
.start();
This falls under "solution 2", but the runtime library takes care of the boilerplate.