ANT to run java program

Here is an example showing how to use ANT to execute a java program.

<target name="abc">
  <java jar="/xxx/yyy/......../go.jar" fork="true">
    <arg value="-input"/>
    <arg value="./src.js"/>
    <arg value="-output"/>
    <arg value="./dst.js"/>
  </java>
</target>

Notice. The argument must be divided into multiple segments and declared as single parameter so that ANT feed them well. If you only declare one containing all argument string, ANT handles it as a long string and it may produce different result on your java program.

oliver

Leave a Reply

Your email address will not be published. Required fields are marked *


*