Attribute | Description | Required |
srcdir | Location of the java files. (See the note below.) | Yes, unless nested <src> elements are present. |
destdir | Location to store the class files. | No |
includes | Comma- or space-separated list of files (may be specified using wildcard patterns) that must be included; all .java files are included when omitted. | No |
includesfile | The name of a file that contains a list of files to include (may be specified using wildcard patterns). | No |
excludes | Comma- or space-separated list of files (may be specified using wildcard patterns) that must be excluded; no files (except default excludes) are excluded when omitted. | No |
excludesfile | The name of a file that contains a list of files to exclude (may be specified using wildcard patterns). | No |
classpath | The classpath to use. | No |
sourcepath | The sourcepath to use; defaults to the value of the srcdir attribute (or nested <src> elements). To suppress the sourcepath switch, use sourcepath="". | No |
bootclasspath | Location of bootstrap class files. | No |
classpathref | The classpath to use, given as a reference to a path defined elsewhere. | No |
sourcepathref | The sourcepath to use, given as a reference to a path defined elsewhere. | No |
bootclasspathref | Location of bootstrap class files, given as a reference to a path defined elsewhere. | No |
extdirs | Location of installed extensions. | No |
encoding | Encoding of source files. (Note: gcj doesn't support this option yet.) | No |
nowarn | Indicates whether the -nowarn switch should be passed to the compiler; defaults to off. | No |
debug | Indicates whether source should be compiled with debug information; defaults to off. If set to off, -g:none will be passed on the command line for compilers that support it (for other compilers, no command line argument will be used). If set to true, the value of the debuglevel attribute determines the command line argument. | No |
debuglevel | Keyword list to be appended to the -g command-line switch. This will be ignored by all implementations except modern and classic(ver >= 1.2). Legal values are none or a comma-separated list of the following keywords: lines, vars, and source. If debuglevel is not specified, by default, nothing will be appended to -g. If debug is not turned on, this attribute will be ignored. | No |
optimize | Indicates whether source should be compiled with optimization; defaults to off. | No |
deprecation | Indicates whether source should be compiled with deprecation information; defaults to off. | No |
target | Generate class files for specific VM version (e.g., 1.1 or 1.2). Note that the default value depends on the JVM that is running Ant. In particular, if you use JDK 1.4 the generated classes will not be usable for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1 (which is the default value for JDK 1.1 to 1.3). | No |
verbose | Asks the compiler for verbose output. | No |
depend | Enables dependency-tracking for compilers that support this (jikes and classic). | No |
includeAntRuntime | Whether to include the Ant run-time libraries in the classpath; defaults to yes. | No |
includeJavaRuntime | Whether to include the default run-time libraries from the executing VM in the classpath; defaults to no. | No |
fork | Whether to execute javac using the JDK compiler externally; defaults to no. | No |
executable | Complete path to the javac executable to use in case of fork="yes". Defaults to the compiler of the Java version that is currently running Ant. Ignored if fork="no" | No |
memoryInitialSize | The initial size of the memory for the underlying VM, if javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m) | No |
memoryMaximumSize | The maximum size of the memory for the underlying VM, if javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m) | No |
failonerror | Indicates whether the build will continue even if there are compilation errors; defaults to true. | No |
source | Value of the -source command-line switch; will be ignored by all implementations except javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes. If you use this attribute together with jikes, you must make sure that your version of jikes supports the -source switch. Legal values are 1.3 and 1.4 - by default, no -source argument will be used at all. | No |
compiler | The compiler implementation to use. If this attribute is not set, the value of the build.compiler property, if set, will be used. Otherwise, the default compiler for the current VM will be used. (See the above list of valid compilers.) | No |
listfiles | Indicates whether the source files to be compiled will be listed; defaults to no. | No |