ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <>
Subject Re: Launch a separate process(terminal window) from Ant [Linux]
Date Tue, 07 Aug 2001 16:59:06 GMT
BlaineNewsletters(@yahoo) wrote:

>I'm trying to launch a separate process from Ant (call Weblogic's startup
>script, in a new window, and have the original window run
>in parallel.
>This is no problem within Win2000. I use the exec task to call "start" to
>launch a new window and give it the command line parameters for
>When trying to use the exec task for Linux, I can't accomplish the same
>thing. I've tried various different methods (xterm, sh) but without success.
>I can get a new terminal launched and weblogic runs, but the originating
>terminal waits for weblogic to complete before continuing.
>I haven't been able to figure out a way to correctly do this and I was
>hoping somebody else had. As a last resort, people have suggested I call
>"java" and then use "fork" to return control back to Ant.
>Any suggestions?
><!--method #1-->
><target name="start.weblogic_600" >
>    <exec dir="${appsrv.home}" executable="start" os="Windows 2000,Windows
>            <arg line="startWebLogic.cmd" />
>            <env key="BEA_HOME" value="${bea.home}" />
>    </exec>
>    <exec dir="${appsrv.home}/config/mydomain" executable="/bin/sh"
>            <arg line="./ " />
>    </exec>
><!--method #2-->
><target name="start.weblogic_600" >
><exec dir="${appsrv.home}" executable="start" os="Windows 2000,Windows NT">
><arg line="startWebLogic.cmd" />
><env key="BEA_HOME" value="${bea.home}" />
><exec executable="${appsrv.home}/config/mydomain/"
>------------------------------Contents of
>pushd /usr/local/bea/wlserver6.0/config/mydomain
>xterm -e "" &
>Blaine Kendall, QA Developer
>Everypath Canada Corp |
>Do You Yahoo!?
>Get your free address at
PS:   you could write a task which spawned your process through
java.lang.Runtime.exec() in a seperate thread.  So what would happen
is your task would spawn the thread, and return control to ant, thereby
running your process in the background.

Matt Inger (
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 

View raw message