running external program in directory different from working dir
My java code calls an external program. This program produces a file that is created in the working directory where my java code was called from.
I call the external program like this:
Runtime r = Runtime.getRuntime();
Process p = r.exec("C:/my_program.exe");
This is what I want: my external program needs to be executed in a subdirectory of my current working directory.
Apparently, if I add the following before I call the external program
it has no effect on the location of the file created by the external program.
Any suggestions, ideas?
thanks in advance,