File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Killing  a Java Process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Killing  a Java Process" Watch "Killing  a Java Process" New topic
Author

Killing a Java Process

sharidasa hari
Greenhorn

Joined: Oct 20, 2003
Posts: 1
Hi,
I start a new process in Java using Process.exec.
If I wanted to a send ^c (contol C ) to the process via Java program, how do I go about doing it?
I have a peice of code where when a button is pressed, the process is supposed to abort. To do this I have the following code..
proc.destroy()
proc.waitFor()
setState(ABORT);
If the AWT event queue thread is actually calling this function, technically is it supposed to wait for the Sub process to complete before it sets the state.
There are situations where the proc.getOutputStream() continues to read data when the proc.destroy is issued and after the state is set..
So, I am trying to kill the process by issuing a control C..
your help is really appreciated.
thanks
Sri
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Killing a Java Process
 
Similar Threads
Stopping the Process Forcefully......
Runtime.exec("c.bat")
how to use Process.destroy()
problem running sqlplus using Runtime.exec()
How to free CPU utilised?