I was thinking more of listing the current running processes in windows and then killing one of them.
Knuplesch, Jürgen wrote: > > As far as I know, there is the possibilty to set a timeout, if that is > waht you want! > > > -- > Jürgen Knuplesch www.icongmbh.de > icon Systemhaus GmbH Tel. +49 711 806098-275 > Sophienstraße 40 > D-70178 Stuttgart Fax. +49 711 806098-299 > > Geschäftsführer: Uwe Seltmann > HRB Stuttgart 17655 > USt-IdNr.: DE 811944121 > -----Ursprüngliche Nachricht----- > Von: arijit [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 8. Juni 2007 15:39 > An: user@ant.apache.org > Betreff: Re: how to get a process id from a spawned task? > > > I followed the suggestion that Prashant had provided and executed jps from > within ant by using <exec>. However, if I want to kill a process running > under windows, how will I be able to do that ? > > > arijit wrote: >> >> Being a newbie here, can you please elaborate a little more on how you >> resolved this problem ? >> >> >> Jay Dickon Glanville wrote: >>> >>> Thanks. That helped. I used the <propertyregex> task from >>> ant-contrib to retrieve just the process id, and then echoed that to >>> the user. >>> >>> Much appreciated. >>> >>> JDG >>> >>> On 5/28/07, Prashant Reddy <[EMAIL PROTECTED]> wrote: >>>> If you are OK with using JDK 1.5, you could use 'jps' command that >>>> is shipped with every JDK. >>>> >>>> See : http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html >>>> >>>> Output of jps on my computer : >>>> $ ~/programs/java/jdk1.5.0_10/bin/jps >>>> 20608 Jps >>>> 6550 Main >>>> >>>> You could perhaps use ANT's <exec> task to run this command. >>>> >>>> On Mon, 2007-05-28 at 08:19 -0400, Jay Dickon Glanville wrote: >>>> > Hello all. >>>> > >>>> > Is there a way to get the process id (I'm dealing with a windows >>>> > system here, but I believe the question could be asked of both >>>> > windows an UNIX families) of a task that is spawned? I have a java >>>> task: >>>> > <java spawn="true" ... /> >>>> > and I'd like to be able to echo the process id to the user (so >>>> > that they can kill the process if they so desire). >>>> > >>>> > Is there a convenient way to get the process id? >>>> > >>>> > Thanks >>>> > >>>> -- >>>> >>>> -Prashant >>>> >>>> Don't upload, just share : www.dekoh.com >>>> >>>> >>>> -------------------------------------------------------------------- >>>> - To unsubscribe, e-mail: [EMAIL PROTECTED] For >>>> additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>> >>> >>> -- >>> Jay Dickon Glanville >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] For >>> additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/how-to-get-a-process-id-from-a-spawned-task--tf3827737.html#a11026651 > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/how-to-get-a-process-id-from-a-spawned-task--tf3827737.html#a11027290 Sent from the Ant - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]