A primary use of Ant is in the compilation of Java source files. <javac> is the task that gives you the power to do so. It runs the Java compiler on a set of Java source files within a specified directory (including subdirectories). The <javac> task works similarly to the javac executable in that it will compile only .java files that have no corresponding class file, and classes that are older than the corresponding Java file.

Note that because the source is not scanned, a class named fooBar in a file not named fooBar.java will always be compiled.

Table 4.44 lists the <javac> attributes, which include attributes that support all the options that you can pass to javac normally.

Table 4.44. Table of <javac> Attributes
Attributes Description ...

Get Ant Developer’s Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.