ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ninju Bohra <ninju_bo...@yahoo.com>
Subject Re: Spawning a java call in a new command shell
Date Fri, 20 May 2005 15:36:51 GMT
This is the helper target that we use:

    <!--
====================================================================
-->
    <!--         Target to run a java process in the
background               -->
    <!--         with delegation to the OS-specific
targets                   -->
    <!--
====================================================================
-->
    <target name="run.java.server.bg">
       <echo message="os.family = ${os.family}"/>
       <switch value="${os.family}">
          <case value="windows">
             <exec executable="cmd" spawn="true"
dir="${basedir}">
                <arg line="/k start "/>
                <arg
value="&quot;${run.server.description}&quot;"/>
                <arg line="java -cp
&quot;${run.server.classpath}&quot;
${run.server.jvmargline} ${run.server.mainclass}
${run.server.argline}"/>
             </exec>
             <sleep seconds="3"/>
          </case>
          <case value="unix">
             <java classname="${run.server.mainclass}"
spawn="true" fork="true">
                <jvmarg
line="${run.server.jvmargline}"/>
                <arg line="${run.server.argline}"/>
                <classpath>
                   <pathelement
path="${run.server.classpath}"/>
                </classpath>
             </java>
          </case>
          <default>
             <fail message="Unable to run java server
because of unknown os.family value of ${os.family}"/>
          </default>
       </switch>
    </target>

Hope it helps...
--- "Alexey N. Solofnenko" <A.Solofnenko@mdl.com>
wrote:
> On Windows you can execute 'cmd /c start "Window
> title" command', on 
> Unix ('pwd' is usually executed on Unix) it can be
> done by executing 
> "xterm ...". You will also pause at the end, so the
> window is not closed.
> 
> - Alexey.
> 
> Brian Kuhn wrote:
> 
> >I think this is more of a windows than an ant
> question;
> >
> >Does anyone know if it's possible to create a new
> window when spawning
> >a cmd command?  For instance, I'd like to have the
> following exec task
> >create a new cmd window so I can see the results. 
> This is an example:
> >
> ><exec executable="cmd" spawn="true"
> dir="${windows.weblogicDir}">
> >      <arg line="/c pwd"/>
> ></exec>
> >
> >Thanks,
> >     Brian
> >  
> >
> -- 
>
------------------------------------------------------------------------
> / Alexey N. Solofnenko
> home: http://trelony.cjb.net/
> /
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message