Destroying spawned ant process, from windows, does not work. Unix variants this works fine but from windows this does not work. Code snippet is below. While the return code is correct (1) the spawned process continues to execute until done. Only a problem on a windows. Any ideas?
ProcessBuilder build = new ProcessBuilder();
List<String> list = build.command();
list.add("cmd");
list.add("/C");
list.add("ant");
list.add("-f");
list.add("HelloWorld.xml");
try {
Process p = build.start();
Thread.sleep(5000);
p.destroy();
int i = p.waitFor();
System.out.println(i);
} catch (Exception e) {
System.out.println(e);
}