Article View: borland.public.jbuilder.java.api
Article #408Help on Process.destroy(),......why it doesn't work.
From: David Huang
Date: Sat, 22 Nov 2003 02:27
Date: Sat, 22 Nov 2003 02:27
29 lines
1506 bytes
1506 bytes
hi all,
I have a program that does Runtime.exec(a bat/sh script file), which will
start a java process.
When I tried to destroy this process using process.destroy(), it does not
work.
Can some one help me ..?
my code looks like this:
Runtime rt = Runtime.getRunTime();
Process process = rt.exec(MyScriptFile);
try{
Thread.sleep(5000); //just waiting for process started by my script
file to initialize
}catch(Exception ex){}
process.destroy();
Thanks
David
Technical Details
Message-ID:
<3fbec8a7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!pd7cy2so!shaw.ca!news-out.superfeed.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,76f0d7b0ceca596d,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2003-11-21 18:29:31 PST From: "David Huang" <dayicool@sina.com> Newsgroups: borland.public.jbuilder.java.api Subject: Help on Process.destroy(),......why it doesn't work. Date: Sat, 22 Nov 2003 10:27:28 +0800 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 218.5.84.96 Message-ID: <3fbec8a7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069467815 218.5.84.96 (21 Nov 2003 18:23:35 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!pd7cy2so!shaw.ca!news-out.superfeed.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail