Apache Ant: How to pass system properties to java program from Ant command line

By Angsuman Chakraborty, Gaea News Network
Friday, January 22, 2010

Define the system properties in command line by specifying:
ant run -Dhost=arjun

Generically you can pass properties by -Dkey=value format
You can pass multiple properties this way.

To use these properties within your java program use sysproperty to pass them as shown in the example below:

code2

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :