Java Mailing List Archive

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

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: new ant user - trying to run java cmd

AW: new ant user - trying to run java cmd

2007-07-31       - By Jan.Materne@(protected)

* dont write a <echo> inside the <manifest>
* when specifying a main-class, use '.' as package-delimiters, not '/'
* when starting
 - you could use the jar-attribute (as you have a main-class defined) or
 - provide the full qualified classname 'com.tech.simulators.Main'
* but dont expect that nested JARs are on your applications classpath ...


Jan


>-----Urspr?ngliche Nachricht-----
>Von: triona28 [mailto:vinnie.timoney@(protected)]
>Gesendet: Dienstag, 31. Juli 2007 10:13
>An: user@(protected)
>Betreff: new ant user - trying to run java cmd
>
>
>Hi,
>   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"
>          outputproperty="AppVersion"
>          resolveExecutable="true">
>      <arg value="${AppPath}/src/version.cpp"/>
>      <arg value="-report"/>
>    </exec>
>
>    <property name="jar.name"
>value="${build}/HostSimulators_${AppVersion}.jar" />
>    
>
>    <jar destfile="${jar.name}">
>      <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"/>
>      </fileset>
>
>      <manifest>
>         <echo>mainfest</echo>
>         <attribute name="Main-Class"
>value="com/tech/simulators/Main"/>
>      </manifest>
>    </jar>
>  </target>
>
>now when I run my Main.java 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="${jar.name}" fork="true"/>
>  </target>
>but with no luck!!
>
>please help,
>
>tri
>--
>View this message in context:
>http://www.nabble.com/new-ant-user---trying-to-run-java-cmd-tf4
>191525.html#a11919932
>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.