how use Runtime.getRuntime().exec()?
I try:
try {
String[] callAndArgs = {"path\\program.exe","arg1","arg2","arg3"}
System.out.println("before");
Process p = Runtime.getRuntime().exec(callAndArgs)
System.out.println("in");
p.waitFor();
System.out.println("after");
} catch (IOException e) {
System.out.println("catch io: " + e.getMessage());
} catch (InterruptedException ie) {
System.out.println("catch ie: " + ie.getMessage());
}
And program doesn’t work. Output:
before
in
after
hm? help ;p
See this (classic) article: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html