Java ANT Question:
How to use ant to run a Java application?

Answer:
The following is an example to run a java application in using ant:
<target name=”run” depends=”some.target”,some.other.target”>
<java classname=”${run.class}” fork=”yes”>
<classpath>
<path refrid = “classpath” />
</classpath>
<jvmarg line=”${debug.jvmargs}”/>
<jvmarg line=”${my.jvmargs}”/> < BR><jvmargvalue=”-Dname=${name}”/>
<jvmarg line=”${run.jvmargs}”/>
<arg line=”${run.args}”/>
</java>
</target>
<target name=”run” depends=”some.target”,some.other.target”>
<java classname=”${run.class}” fork=”yes”>
<classpath>
<path refrid = “classpath” />
</classpath>
<jvmarg line=”${debug.jvmargs}”/>
<jvmarg line=”${my.jvmargs}”/> < BR><jvmargvalue=”-Dname=${name}”/>
<jvmarg line=”${run.jvmargs}”/>
<arg line=”${run.args}”/>
</java>
</target>
Previous Question | Next Question |
How to write your own ant task? | Tell me how to use Runtime in ant? |