Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Parameters in Java task

Thread view: 
andrewzzz - 01 Mar 2007 11:56 GMT
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"/>
Mark Jeffcoat - 01 Mar 2007 16:44 GMT
> Hi guys,
> The java class that I wan't to run (with java task) requires a
[quoted text clipped - 8 lines]
> 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

Signature

Mark Jeffcoat
Austin, TX



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.