Ant supports properties, file sets, and paths. Properties are to Ant build scripts as environment variables are to shell scripts and batch files. Properties allow you to define string constants that can be reused. The general rule is that if you use a string literal more than twice, you should probably create a property for it. Later when you need to modify the string constant, if you've defined it as a property you have to change it only once. In Listing 20.2 we've defined two properties: lib and outputdir.
<property name="lib" value="../lib"/>...
<path id="myclasspath">
<pathelement path=".;${lib}/log4j.jar"/>
<fileset dir="${lib}">
<javac srcdir="./src" destdir="${ outputdir}/classes" > <classpath refid="myclasspath"/>
</javac>