Problem is stopping an exe from Java

I have created a Thread for an FTP process. In the run method I instantiated an exe. Which will download data from a site and store it in my PC concurrently when I have opened an applcation.

Now when I close this application, I want to kill or stop this exe.

I dont have an access to this exe in the Runtime env.

Please let me know how to kill or stop this exe.

Ex:

Suppose X is a class which is an Applct:

Inside this X: I created a thread Y: which does the FTP download

Now when I click the exit button of the X class--I am trying to close the main thread as the ftp thread is the child thread for this..

Now the exe which is started in the Y thread should be stopped....how can I do this....I am starting this exe using Runtime.getRuntime().exec(**.exe).

[813 byte] By [Java_Inda] at [2007-11-27 10:17:05]
# 1

Hi,

I am also facing the similar issue, Please let me know if you find an answer for the same...

thanks

Shubha

ShubhaSa at 2007-7-28 15:49:24 > top of Java-index,Desktop,Runtime Environment...
# 2

try using ProcessBuilder it's start method returns Process which has destroy()

hope this helps

regards

Aniruddha

Aniruddha-Herea at 2007-7-28 15:49:24 > top of Java-index,Desktop,Runtime Environment...