Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: how to get a process id from a spawned task?

AW: how to get a process id from a spawned task?

2007-06-08       - By Knuplesch, J?rgen
Reply:     1     2     3     4     5     6     7  

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:ghosh.arijit@(protected)]
Gesendet: Freitag, 8. Juni 2007 15:39
An: user@(protected)
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 <prashant@(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: user-unsubscribe@(protected) For
>>> additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>>
>> --
>> Jay Dickon Glanville
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected) For
>> additional commands, e-mail: user-help@(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: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.