Is there a platform-independent way in Java to start an external process that executes program which it finds using the system path?
It should work at least on Windows, Linux and Mac.
Normally your have to give the full path to an executable file, like this:
new ProcessBuilder("/some/path/execfile", "arg").start();
It is possible to start a program that is on the system path by starting a shell:
new ProcessBuilder("/bin/bash", "-c", "execfile", "arg").start();
But this is not portable between OS:s. (This is the solution that is given to this question.)