Parameters in Java task

A

andrewzzz

Hi guys,
The java class that I wan't to run (with java task) requires a
commandline parameter : a single String character.
I know that in the build.xml I can specify attributes...but It's not
possible to let the user choose...
How do I let the user insert a command line parameter???
Thanks a lot!!!

actual target
<target name="initiator" depends="compile"
description="execute app.initiator,requires config parameter">
<java classname="app.Initiator" fork="true" classpath="classes"/>
 
M

Mark Jeffcoat

andrewzzz said:
Hi guys,
The java class that I wan't to run (with java task) requires a
commandline parameter : a single String character.
I know that in the build.xml I can specify attributes...but It's not
possible to let the user choose...
How do I let the user insert a command line parameter???
Thanks a lot!!!

actual target
<target name="initiator" depends="compile"
description="execute app.initiator,requires config parameter">
<java classname="app.Initiator" fork="true" classpath="classes"/>

How about:

<target name="example">
<echo>${set.me}</echo>
</target>

Then on the command line

ant -Dset.me="Whatever you like" example
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top