ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pushkar Prasad" <>
Subject RE: new ant user - trying to run java cmd
Date Tue, 31 Jul 2007 08:33:29 GMT
<target name="run" depends="jar">
    <java jar="PathtoJar/jarname.jar" fork="true"/>

and yes.. add a manifest to jar (Main class where the main() is there )

-----Original Message-----
From: triona28 [] 
Sent: Tuesday, July 31, 2007 1:43 PM
Subject: new ant user - trying to run java cmd

   I'm trying to run a class from built jar using ant but my script doesn't
pick up even my echos around it - what am I doing wrong?
this is the bit that's already in my script & works:
<target name="jar" depends="compile, expandjars" description="generate JAR
file" >
    <exec executable="${AppPath}/host/vergen.exe"
      <arg value="${AppPath}/src/version.cpp"/>
      <arg value="-report"/>

    <property name=""
value="${build}/HostSimulators_${AppVersion}.jar" />

    <jar destfile="${}">
      <fileset dir="${build}/classes" />
      <fileset dir="${build}/jar"/>

      <fileset dir="src">
         <include name="**/*.jpg"/>
         <include name="**/*.properties"/>
         <include name="**/*.gif"/>
         <include name="**/*.txt"/>
         <include name="**/*.ghost"/>
         <include name="**/*.dec"/>
         <include name="**/*.nan"/>

         <attribute name="Main-Class" value="com/tech/simulators/Main"/>

now when I run my in Eclipse - I use the Run -> Run with program
parameters {-cfg /simulators/simulators.cfg}

how can I do this Run in Ant? I've tried:
<target name="run" depends="jar">
    <java classname="Main" classpath="${}" fork="true"/>
but with no luck!!

please help,

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message