Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters in Java task

Status
Not open for further replies.

madcowzz

Programmer
Mar 1, 2007
1
IT
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"/>
 
Use the input task to get user input and assign it to an Ant property, then use an <arg> tag inside the java task to pass the value of that property to the java program as an argument.

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top