Ctrl+c to terminate program problem


I've got this problem trying to kill a process spawned from another app.

Can't out how to get the spawned process to receive a ctrl-c to interrupt it so I can send a "Y" to kill it.

http://forum.java.sun.com/thread.jspa?messageID=3882966 had the same probelm/solution, but has not replied with their solution.

Anyone here care to take a crack at it?



Are you talking about Runtime.exec(…) here? In this case simply call destroy() on the returned Process.

doesn't work…and I;ve tried a few process create/destroy methods as shown in various java articles.

The app that starts up seems to run indepedantly such that killing the spawn process does not effect it.

The only way seems to be to send the console Ctrl-c then "y" to kill it. But I can;t figure out how to send it ctrl-c as none of the way's I've tried work.