My program getting command line arguments. How can I pass it when I use Ant?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Extending Richard Cook‘s answer.
Here’s the
anttask to run any program (including, but not limited to Java programs):Here’s the task to run a Java program from a
.jarfile:You can invoke either from the command line like this:
Make sure to use the
-Dargsyntax; if you ran this:then
antwould try to run targetsarg0andarg1.