I've got a executable JAR file. And I've got an Ant build script that compiles and then creates this JAR file. I would like a task to run the JAR file as well, but I've got a command line argument that needs to be passed to the JAR. It's a configuration file. The run target is below
<target name="run">
<java jar="build/jar/ShoutGen.jar" fork="true"/>
<arg line="/home/munderwo/workspace/ShoutGen-Java/ShoutGen.conf"/>
</target>
When I try to do this and run it from within Eclipse I get
Buildfile: /home/munderwo/workspace/ShoutGen-Java/build.xml
run:
[java] No config file passed as an argument. Please pass a configuration file
[java] Java Result: 16
BUILD FAILED
/home/munderwo/workspace/ShoutGen-Java/build.xml:24: Problem: failed to create task or type arg
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
The error output from Java is my coded error meaning "you didn't pass an config file as an argument" which backs up the ant error of "Problem: failed to create task or type arg".
So how do you pass an argument to an executed JAR file from within Ant? Is this something your not supposed to do?