I have this code:
try {
Process p = new ProcessBuilder(
"/Applications/TorBrowser_en-US.app/Contents/MacOS/./tor",
"-f /Applications/TorBrowser_en-US.app/Library/filetctor/torrc")
.start();
p.waitFor();
int exitVal = p.exitValue();
System.out.println("Process exitValue: " + exitVal);
} catch (IOException e) {
System.out.println(e);
} catch (InterruptedException e) {
System.out.println(e);
}
Every time i execute it, i get a 255 exitValue. The process doesn't run properly.
If i run the program with only:
Process p = new ProcessBuilder("/Applications/TorBrowser_en-US.app/Contents/MacOS/./tor").start();
The process runs correctly. But i need to use the -f option.
What is the problem? Am i writing it incorrectly?