Javac (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: Javac

# Class Javac

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.tools.ant.taskdefs.Javac

All Implemented Interfaces:
  `Cloneable, SelectorContainer`

public class Javac extends MatchingTask
Compiles Java source files. This task can take the following arguments:

- sourcedir
- destdir
- deprecation
- classpath
- bootclasspath
- extdirs
- optimize
- debug
- encoding
- target
- depend
- verbose
- failonerror
- includeantruntime
- includejavaruntime
- source
- compiler
- release

Of these arguments, the sourcedir and destdir are required.

When this task executes, it will recursively scan the sourcedir and destdir looking for Java source files to compile. This task makes its compile decision based on timestamp.

Since:
  Ant 1.1

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `Javac.ImplementationSpecificArgument`
  Adds an "compiler" attribute to Commandline$Attribute used to filter command line attributes based on the current implementation.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected File[]`
  `compileList`
  `protected boolean`
  `failOnError`
  `protected boolean`
  `listFiles`

  ### Fields inherited from class MatchingTask

  `fileset`
  Modifier and Type
  Field
  Description
  `protected FileSet`
  `fileset`

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Javac()`
  Javac task for compilation of Java files.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(CompilerAdapter adapter)`
  Set the compiler adapter explicitly.
  `protected void`
  `checkParameters()`
  Check that all required attributes have been set and nothing silly has been entered.
  `protected void`
  `compile()`
  Perform the compilation.
  `Path`
  `createBootclasspath()`
  Adds a path to the bootclasspath.
  `Path`
  `createClasspath()`
  Adds a path to the classpath.
  `Javac.ImplementationSpecificArgument`
  `createCompilerArg()`
  Adds an implementation specific command-line argument.
  `Path`
  `createCompilerClasspath()`
  The classpath to use when loading the compiler implementation if it is not a built-in one.
  `Path`
  `createExtdirs()`
  Adds a path to extdirs.
  `Path`
  `createModulepath()`
  Adds a path to the modulepath.
  `Path`
  `createModulesourcepath()`
  Adds a path to modulesourcepath.
  `Path`
  `createSourcepath()`
  Adds a path to sourcepath.
  `Path`
  `createSrc()`
  Adds a path for source compilation.
  `Path`
  `createUpgrademodulepath()`
  Adds a path to the upgrademodulepath.
  `void`
  `execute()`
  Executes the task.
  `Path`
  `getBootclasspath()`
  Gets the bootclasspath that will be used to compile the classes against.
  `Path`
  `getClasspath()`
  Gets the classpath to be used for this compilation.
  `String`
  `getCompiler()`
  The implementation for this particular task.
  `String`
  `getCompilerVersion()`
  The implementation for this particular task.
  `String[]`
  `getCurrentCompilerArgs()`
  Get the additional implementation specific command line arguments.
  `boolean`
  `getDebug()`
  Gets the debug flag.
  `String`
  `getDebugLevel()`
  Get the value of debugLevel.
  `boolean`
  `getDepend()`
  Gets the depend flag.
  `boolean`
  `getDeprecation()`
  Gets the deprecation flag.
  `File`
  `getDestdir()`
  Gets the destination directory into which the java source files should be compiled.
  `String`
  `getEncoding()`
  Gets the java source file encoding name.
  `String`
  `getExecutable()`
  The value of the executable attribute, if any.
  `Path`
  `getExtdirs()`
  Gets the extension directories that will be used during the compilation.
  `boolean`
  `getFailonerror()`
  Gets the failonerror flag.
  `File[]`
  `getFileList()`
  Gets the list of files to be compiled.
  `boolean`
  `getIncludeantruntime()`
  Gets whether or not the ant classpath is to be included in the classpath.
  `boolean`
  `getIncludejavaruntime()`
  Gets whether or not the java runtime should be included in this task's classpath.
  `String`
  `getJavacExecutable()`
  The name of the javac executable to use in fork-mode.
  `boolean`
  `getListfiles()`
  Get the listfiles flag.
  `String`
  `getMemoryInitialSize()`
  Gets the memoryInitialSize flag.
  `String`
  `getMemoryMaximumSize()`
  Gets the memoryMaximumSize flag.
  `Path`
  `getModulepath()`
  Gets the modulepath to be used for this compilation.
  `Path`
  `getModulesourcepath()`
  Gets the modulesourcepath to be used for this compilation.
  `File`
  `getNativeHeaderDir()`
  Gets the destination directory into which the generated native header files should be placed.
  `boolean`
  `getNowarn()`
  Should the -nowarn option be used.
  `boolean`
  `getOptimize()`
  Gets the optimize flag.
  `String`
  `getRelease()`
  Gets the version to use for the `--release` switch that combines `source`, `target` and setting the bootclasspath.
  `String`
  `getSource()`
  Get the value of source.
  `Path`
  `getSourcepath()`
  Gets the sourcepath to be used for this compilation.
  `Path`
  `getSrcdir()`
  Gets the source dirs to find the source java files.
  `protected String`
  `getSystemJavac()`
  `String`
  `getTarget()`
  Gets the target VM that the classes will be compiled for.
  `boolean`
  `getTaskSuccess()`
  Get the result of the javac task (success or failure).
  `File`
  `getTempdir()`
  Where Ant should place temporary files.
  `Path`
  `getUpgrademodulepath()`
  Gets the upgrademodulepath to be used for this compilation.
  `boolean`
  `getVerbose()`
  Gets the verbose flag.
  `boolean`
  `isForkedJavac()`
  Is this a forked invocation of JDK's javac?
  `boolean`
  `isIncludeDestClasses()`
  Get the value of the includeDestClasses property.
  `protected boolean`
  `isJdkCompiler(String compilerImpl)`
  Is the compiler implementation a jdk compiler
  `protected Path`
  `recreateSrc()`
  Recreate src.
  `protected void`
  `resetFileLists()`
  Clear the list of files to be compiled and copied..
  `protected void`
  `scanDir(File srcDir, File destDir, String[] files)`
  Scans the directory looking for source files to be compiled.
  `void`
  `setBootclasspath(Path bootclasspath)`
  Sets the bootclasspath that will be used to compile the classes against.
  `void`
  `setBootClasspathRef(Reference r)`
  Adds a reference to a classpath defined elsewhere.
  `void`
  `setClasspath(Path classpath)`
  Set the classpath to be used for this compilation.
  `void`
  `setClasspathRef(Reference r)`
  Adds a reference to a classpath defined elsewhere.
  `void`
  `setCompiler(String compiler)`
  Choose the implementation for this particular task.
  `void`
  `setCreateMissingPackageInfoClass(boolean b)`
  Whether package-info.class files will be created by Ant matching package-info.java files that have been compiled but didn't create class files themselves.
  `void`
  `setDebug(boolean debug)`
  Indicates whether source should be compiled with debug information; defaults to off.
  `void`
  `setDebugLevel(String v)`
  Keyword list to be appended to the -g command-line switch.
  `void`
  `setDepend(boolean depend)`
  Enables dependency-tracking for compilers that support this (jikes and classic).
  `void`
  `setDeprecation(boolean deprecation)`
  Indicates whether source should be compiled with deprecation information; defaults to off.
  `void`
  `setDestdir(File destDir)`
  Set the destination directory into which the Java source files should be compiled.
  `void`
  `setEncoding(String encoding)`
  Set the Java source file encoding name.
  `void`
  `setErrorProperty(String errorProperty)`
  The property to set on compilation failure.
  `void`
  `setExecutable(String forkExec)`
  Sets the name of the javac executable.
  `void`
  `setExtdirs(Path extdirs)`
  Sets the extension directories that will be used during the compilation.
  `void`
  `setFailonerror(boolean fail)`
  Indicates whether the build will continue even if there are compilation errors; defaults to true.
  `void`
  `setFork(boolean f)`
  If true, forks the javac compiler.
  `void`
  `setIncludeantruntime(boolean include)`
  If true, includes Ant's own classpath in the classpath.
  `void`
  `setIncludeDestClasses(boolean includeDestClasses)`
  This property controls whether to include the destination classes directory in the classpath given to the compiler.
  `void`
  `setIncludejavaruntime(boolean include)`
  If true, includes the Java runtime libraries in the classpath.
  `void`
  `setListfiles(boolean list)`
  If true, list the source files being handed off to the compiler.
  `void`
  `setMemoryInitialSize(String memoryInitialSize)`
  The initial size of the memory for the underlying VM if javac is run externally; ignored otherwise.
  `void`
  `setMemoryMaximumSize(String memoryMaximumSize)`
  The maximum size of the memory for the underlying VM if javac is run externally; ignored otherwise.
  `void`
  `setModulepath(Path mp)`
  Set the modulepath to be used for this compilation.
  `void`
  `setModulepathRef(Reference r)`
  Adds a reference to a modulepath defined elsewhere.
  `void`
  `setModulesourcepath(Path msp)`
  Set the modulesourcepath to be used for this compilation.
  `void`
  `setModulesourcepathRef(Reference r)`
  Adds a reference to a modulesourcepath defined elsewhere.
  `void`
  `setNativeHeaderDir(File nhDir)`
  Set the destination directory into which the generated native header files should be placed.
  `void`
  `setNowarn(boolean flag)`
  If true, enables the -nowarn option.
  `void`
  `setOptimize(boolean optimize)`
  If true, compiles with optimization enabled.
  `void`
  `setProceed(boolean proceed)`
  `void`
  `setRelease(String release)`
  Sets the version to use for the `--release` switch that combines `source`, `target` and setting the bootclasspath.
  `void`
  `setSource(String v)`
  Value of the -source command-line switch; will be ignored by all implementations except modern, jikes and gcj (gcj uses -fsource).
  `void`
  `setSourcepath(Path sourcepath)`
  Set the sourcepath to be used for this compilation.
  `void`
  `setSourcepathRef(Reference r)`
  Adds a reference to a source path defined elsewhere.
  `void`
  `setSrcdir(Path srcDir)`
  Set the source directories to find the source Java files.
  `void`
  `setTarget(String target)`
  Sets the target VM that the classes will be compiled for.
  `void`
  `setTempdir(File tmpDir)`
  Where Ant should place temporary files.
  `void`
  `setUpdatedProperty(String updatedProperty)`
  The property to set on compilation success.
  `void`
  `setUpgrademodulepath(Path ump)`
  Set the upgrademodulepath to be used for this compilation.
  `void`
  `setUpgrademodulepathRef(Reference r)`
  Adds a reference to the upgrademodulepath defined elsewhere.
  `void`
  `setVerbose(boolean verbose)`
  If true, asks the compiler for verbose output.

  ### Methods inherited from class MatchingTask

  `add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems`
  Modifier and Type
  Method
  Description
  `void`
  `add(FileSelector selector)`
  add an arbitrary selector
  `void`
  `addAnd(AndSelector selector)`
  add an "And" selector entry on the selector list
  `void`
  `addContains(ContainsSelector selector)`
  add a contains selector entry on the selector list
  `void`
  `addContainsRegexp(ContainsRegexpSelector selector)`
  add a regular expression selector entry on the selector list
  `void`
  `addCustom(ExtendSelector selector)`
  add an extended selector entry on the selector list
  `void`
  `addDate(DateSelector selector)`
  add a selector date entry on the selector list
  `void`
  `addDepend(DependSelector selector)`
  add a depends selector entry on the selector list
  `void`
  `addDepth(DepthSelector selector)`
  add a depth selector entry on the selector list
  `void`
  `addDifferent(DifferentSelector selector)`
  add a type selector entry on the type list
  `void`
  `addFilename(FilenameSelector selector)`
  add a selector filename entry on the selector list
  `void`
  `addMajority(MajoritySelector selector)`
  add a majority selector entry on the selector list
  `void`
  `addModified(ModifiedSelector selector)`
  add the modified selector
  `void`
  `addNone(NoneSelector selector)`
  add a "None" selector entry on the selector list
  `void`
  `addNot(NotSelector selector)`
  add a "Not" selector entry on the selector list
  `void`
  `addOr(OrSelector selector)`
  add an "Or" selector entry on the selector list
  `void`
  `addPresent(PresentSelector selector)`
  add a present selector entry on the selector list
  `void`
  `addSelector(SelectSelector selector)`
  add a "Select" selector entry on the selector list
  `void`
  `addSize(SizeSelector selector)`
  add a selector size entry on the selector list
  `void`
  `addType(TypeSelector selector)`
  add a type selector entry on the type list
  `void`
  `appendSelector(FileSelector selector)`
  Add a new selector into this container.
  `PatternSet.NameEntry`
  `createExclude()`
  add a name entry on the exclude list
  `PatternSet.NameEntry`
  `createExcludesFile()`
  add a name entry on the include files list
  `PatternSet.NameEntry`
  `createInclude()`
  add a name entry on the include list
  `PatternSet.NameEntry`
  `createIncludesFile()`
  add a name entry on the include files list
  `PatternSet`
  `createPatternSet()`
  add a set of patterns
  `protected DirectoryScanner`
  `getDirectoryScanner(File baseDir)`
  Returns the directory scanner needed to access the files to process.
  `protected final FileSet`
  `getImplicitFileSet()`
  Accessor for the implicit fileset.
  `FileSelector[]`
  `getSelectors(Project p)`
  Returns the set of selectors as an array.
  `boolean`
  `hasSelectors()`
  Indicates whether there are any selectors here.
  `int`
  `selectorCount()`
  Gives the count of the number of selectors in this container
  `Enumeration<FileSelector>`
  `selectorElements()`
  Returns an enumerator for accessing the set of selectors.
  `void`
  `setCaseSensitive(boolean isCaseSensitive)`
  Sets case sensitivity of the file system
  `void`
  `setDefaultexcludes(boolean useDefaultExcludes)`
  Sets whether default exclusions should be used or not.
  `void`
  `setExcludes(String excludes)`
  Sets the set of exclude patterns.
  `void`
  `setExcludesfile(File excludesfile)`
  Sets the name of the file containing the includes patterns.
  `void`
  `setFollowSymlinks(boolean followSymlinks)`
  Sets whether or not symbolic links or Windows junctions should be followed.
  `void`
  `setIncludes(String includes)`
  Sets the set of include patterns.
  `void`
  `setIncludesfile(File includesfile)`
  Sets the name of the file containing the includes patterns.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.
  `void`
  `XsetIgnore(String ignoreString)`
  List of filenames and directory names to not include.
  `void`
  `XsetItems(String itemString)`
  Set this to be the items in the base directory that you want to be included.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### failOnError

    protected boolean failOnError

  - ### listFiles

    protected boolean listFiles

  - ### compileList

    protected File[] compileList

- ## Constructor Details

  - ### Javac

    public Javac()
    Javac task for compilation of Java files.

- ## Method Details

  - ### getDebugLevel

    public String getDebugLevel()
    Get the value of debugLevel.
    Returns:
      value of debugLevel.

  - ### setDebugLevel

    public void setDebugLevel(String v)
    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, :none will be appended to -g. If debug is not turned on, this attribute will be ignored.
    Parameters:
      `v` - Value to assign to debugLevel.

  - ### getSource

    public String getSource()
    Get the value of source.
    Returns:
      value of source.

  - ### setSource

    public void setSource(String v)
    Value of the -source command-line switch; will be ignored by all implementations except modern, jikes and gcj (gcj uses -fsource).

    If you use this attribute together with jikes or gcj, you must make sure that your version of jikes supports the -source switch.

    Legal values are 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, and any integral number bigger than 4 - by default, no -source argument will be used at all.

    Parameters:
      `v` - Value to assign to source.

  - ### createSrc

    public Path createSrc()
    Adds a path for source compilation.
    Returns:
      a nested src element.

  - ### recreateSrc

    protected Path recreateSrc()
    Recreate src.
    Returns:
      a nested src element.

  - ### setSrcdir

    public void setSrcdir(Path srcDir)
    Set the source directories to find the source Java files.
    Parameters:
      `srcDir` - the source directories as a path

  - ### getSrcdir

    public Path getSrcdir()
    Gets the source dirs to find the source java files.
    Returns:
      the source directories as a path

  - ### setDestdir

    public void setDestdir(File destDir)
    Set the destination directory into which the Java source files should be compiled.
    Parameters:
      `destDir` - the destination director

  - ### getDestdir

    public File getDestdir()
    Gets the destination directory into which the java source files should be compiled.
    Returns:
      the destination directory

  - ### setNativeHeaderDir

    public void setNativeHeaderDir(File nhDir)
    Set the destination directory into which the generated native header files should be placed.
    Parameters:
      `nhDir` - where to place generated native header files
    Since:
      Ant 1.9.8

  - ### getNativeHeaderDir

    public File getNativeHeaderDir()
    Gets the destination directory into which the generated native header files should be placed.
    Returns:
      where to place generated native header files
    Since:
      Ant 1.9.8

  - ### setSourcepath

    public void setSourcepath(Path sourcepath)
    Set the sourcepath to be used for this compilation.
    Parameters:
      `sourcepath` - the source path

  - ### getSourcepath

    public Path getSourcepath()
    Gets the sourcepath to be used for this compilation.
    Returns:
      the source path

  - ### createSourcepath

    public Path createSourcepath()
    Adds a path to sourcepath.
    Returns:
      a sourcepath to be configured

  - ### setSourcepathRef

    public void setSourcepathRef(Reference r)
    Adds a reference to a source path defined elsewhere.
    Parameters:
      `r` - a reference to a source path

  - ### setModulesourcepath

    public void setModulesourcepath(Path msp)
    Set the modulesourcepath to be used for this compilation.
    Parameters:
      `msp` - the modulesourcepath
    Since:
      1.9.7

  - ### getModulesourcepath

    public Path getModulesourcepath()
    Gets the modulesourcepath to be used for this compilation.
    Returns:
      the modulesourcepath
    Since:
      1.9.7

  - ### createModulesourcepath

    public Path createModulesourcepath()
    Adds a path to modulesourcepath.
    Returns:
      a modulesourcepath to be configured
    Since:
      1.9.7

  - ### setModulesourcepathRef

    public void setModulesourcepathRef(Reference r)
    Adds a reference to a modulesourcepath defined elsewhere.
    Parameters:
      `r` - a reference to a modulesourcepath
    Since:
      1.9.7

  - ### setClasspath

    public void setClasspath(Path classpath)
    Set the classpath to be used for this compilation.
    Parameters:
      `classpath` - an Ant Path object containing the compilation classpath.

  - ### getClasspath

    public Path getClasspath()
    Gets the classpath to be used for this compilation.
    Returns:
      the class path

  - ### createClasspath

    public Path createClasspath()
    Adds a path to the classpath.
    Returns:
      a class path to be configured

  - ### setClasspathRef

    public void setClasspathRef(Reference r)
    Adds a reference to a classpath defined elsewhere.
    Parameters:
      `r` - a reference to a classpath

  - ### setModulepath

    public void setModulepath(Path mp)
    Set the modulepath to be used for this compilation.
    Parameters:
      `mp` - an Ant Path object containing the modulepath.
    Since:
      1.9.7

  - ### getModulepath

    public Path getModulepath()
    Gets the modulepath to be used for this compilation.
    Returns:
      the modulepath
    Since:
      1.9.7

  - ### createModulepath

    public Path createModulepath()
    Adds a path to the modulepath.
    Returns:
      a modulepath to be configured
    Since:
      1.9.7

  - ### setModulepathRef

    public void setModulepathRef(Reference r)
    Adds a reference to a modulepath defined elsewhere.
    Parameters:
      `r` - a reference to a modulepath
    Since:
      1.9.7

  - ### setUpgrademodulepath

    public void setUpgrademodulepath(Path ump)
    Set the upgrademodulepath to be used for this compilation.
    Parameters:
      `ump` - an Ant Path object containing the upgrademodulepath.
    Since:
      1.9.7

  - ### getUpgrademodulepath

    public Path getUpgrademodulepath()
    Gets the upgrademodulepath to be used for this compilation.
    Returns:
      the upgrademodulepath
    Since:
      1.9.7

  - ### createUpgrademodulepath

    public Path createUpgrademodulepath()
    Adds a path to the upgrademodulepath.
    Returns:
      an upgrademodulepath to be configured
    Since:
      1.9.7

  - ### setUpgrademodulepathRef

    public void setUpgrademodulepathRef(Reference r)
    Adds a reference to the upgrademodulepath defined elsewhere.
    Parameters:
      `r` - a reference to an upgrademodulepath
    Since:
      1.9.7

  - ### setBootclasspath

    public void setBootclasspath(Path bootclasspath)
    Sets the bootclasspath that will be used to compile the classes against.
    Parameters:
      `bootclasspath` - a path to use as a boot class path (may be more than one)

  - ### getBootclasspath

    public Path getBootclasspath()
    Gets the bootclasspath that will be used to compile the classes against.
    Returns:
      the boot path

  - ### createBootclasspath

    public Path createBootclasspath()
    Adds a path to the bootclasspath.
    Returns:
      a path to be configured

  - ### setBootClasspathRef

    public void setBootClasspathRef(Reference r)
    Adds a reference to a classpath defined elsewhere.
    Parameters:
      `r` - a reference to a classpath

  - ### setExtdirs

    public void setExtdirs(Path extdirs)
    Sets the extension directories that will be used during the compilation.
    Parameters:
      `extdirs` - a path

  - ### getExtdirs

    public Path getExtdirs()
    Gets the extension directories that will be used during the compilation.
    Returns:
      the extension directories as a path

  - ### createExtdirs

    public Path createExtdirs()
    Adds a path to extdirs.
    Returns:
      a path to be configured

  - ### setListfiles

    public void setListfiles(boolean list)
    If true, list the source files being handed off to the compiler.
    Parameters:
      `list` - if true list the source files

  - ### getListfiles

    public boolean getListfiles()
    Get the listfiles flag.
    Returns:
      the listfiles flag

  - ### setFailonerror

    public void setFailonerror(boolean fail)
    Indicates whether the build will continue even if there are compilation errors; defaults to true.
    Parameters:
      `fail` - if true halt the build on failure

  - ### setProceed

    public void setProceed(boolean proceed)
    Parameters:
      `proceed` - inverse of failoferror

  - ### getFailonerror

    public boolean getFailonerror()
    Gets the failonerror flag.
    Returns:
      the failonerror flag

  - ### setDeprecation

    public void setDeprecation(boolean deprecation)
    Indicates whether source should be compiled with deprecation information; defaults to off.
    Parameters:
      `deprecation` - if true turn on deprecation information

  - ### getDeprecation

    public boolean getDeprecation()
    Gets the deprecation flag.
    Returns:
      the deprecation flag

  - ### setMemoryInitialSize

    public void setMemoryInitialSize(String 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)
    Parameters:
      `memoryInitialSize` - string to pass to VM

  - ### getMemoryInitialSize

    public String getMemoryInitialSize()
    Gets the memoryInitialSize flag.
    Returns:
      the memoryInitialSize flag

  - ### setMemoryMaximumSize

    public void setMemoryMaximumSize(String 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)
    Parameters:
      `memoryMaximumSize` - string to pass to VM

  - ### getMemoryMaximumSize

    public String getMemoryMaximumSize()
    Gets the memoryMaximumSize flag.
    Returns:
      the memoryMaximumSize flag

  - ### setEncoding

    public void setEncoding(String encoding)
    Set the Java source file encoding name.
    Parameters:
      `encoding` - the source file encoding

  - ### getEncoding

    public String getEncoding()
    Gets the java source file encoding name.
    Returns:
      the source file encoding name

  - ### setDebug

    public void setDebug(boolean debug)
    Indicates whether source should be compiled with debug information; defaults to off.
    Parameters:
      `debug` - if true compile with debug information

  - ### getDebug

    public boolean getDebug()
    Gets the debug flag.
    Returns:
      the debug flag

  - ### setOptimize

    public void setOptimize(boolean optimize)
    If true, compiles with optimization enabled.
    Parameters:
      `optimize` - if true compile with optimization enabled

  - ### getOptimize

    public boolean getOptimize()
    Gets the optimize flag.
    Returns:
      the optimize flag

  - ### setDepend

    public void setDepend(boolean depend)
    Enables dependency-tracking for compilers that support this (jikes and classic).
    Parameters:
      `depend` - if true enable dependency-tracking

  - ### getDepend

    public boolean getDepend()
    Gets the depend flag.
    Returns:
      the depend flag

  - ### setVerbose

    public void setVerbose(boolean verbose)
    If true, asks the compiler for verbose output.
    Parameters:
      `verbose` - if true, asks the compiler for verbose output

  - ### getVerbose

    public boolean getVerbose()
    Gets the verbose flag.
    Returns:
      the verbose flag

  - ### setTarget

    public void setTarget(String target)
    Sets the target VM that the classes will be compiled for. Valid values depend on the compiler, for jdk 1.4 the valid values are "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9" and any integral number bigger than 4
    Parameters:
      `target` - the target VM

  - ### getTarget

    public String getTarget()
    Gets the target VM that the classes will be compiled for.
    Returns:
      the target VM

  - ### setRelease

    public void setRelease(String release)
    Sets the version to use for the `--release` switch that combines `source`, `target` and setting the bootclasspath. Values depend on the compiler, for jdk 9 the valid values are "6", "7", "8", "9".
    Parameters:
      `release` - the value of the release attribute
    Since:
      Ant 1.9.8

  - ### getRelease

    public String getRelease()
    Gets the version to use for the `--release` switch that combines `source`, `target` and setting the bootclasspath.
    Returns:
      the value of the release attribute
    Since:
      Ant 1.9.8

  - ### setIncludeantruntime

    public void setIncludeantruntime(boolean include)
    If true, includes Ant's own classpath in the classpath.
    Parameters:
      `include` - if true, includes Ant's own classpath in the classpath

  - ### getIncludeantruntime

    public boolean getIncludeantruntime()
    Gets whether or not the ant classpath is to be included in the classpath.
    Returns:
      whether or not the ant classpath is to be included in the classpath

  - ### setIncludejavaruntime

    public void setIncludejavaruntime(boolean include)
    If true, includes the Java runtime libraries in the classpath.
    Parameters:
      `include` - if true, includes the Java runtime libraries in the classpath

  - ### getIncludejavaruntime

    public boolean getIncludejavaruntime()
    Gets whether or not the java runtime should be included in this task's classpath.
    Returns:
      the includejavaruntime attribute

  - ### setFork

    public void setFork(boolean f)
    If true, forks the javac compiler.
    Parameters:
      `f` - "true|false|on|off|yes|no"

  - ### setExecutable

    public void setExecutable(String forkExec)
    Sets the name of the javac executable.

    Ignored unless fork is true or extJavac has been specified as the compiler.

    Parameters:
      `forkExec` - the name of the executable

  - ### getExecutable

    public String getExecutable()
    The value of the executable attribute, if any.
    Returns:
      the name of the java executable
    Since:
      Ant 1.6

  - ### isForkedJavac

    public boolean isForkedJavac()
    Is this a forked invocation of JDK's javac?
    Returns:
      true if this is a forked invocation

  - ### getJavacExecutable

    public String getJavacExecutable()
    The name of the javac executable to use in fork-mode.

    This is either the name specified with the executable attribute or the full path of the javac compiler of the VM Ant is currently running in - guessed by Ant.

    You should not invoke this method if you want to get the value of the executable command - use `getExecutable` for this.

    Returns:
      the name of the javac executable

  - ### setNowarn

    public void setNowarn(boolean flag)
    If true, enables the -nowarn option.
    Parameters:
      `flag` - if true, enable the -nowarn option

  - ### getNowarn

    public boolean getNowarn()
    Should the -nowarn option be used.
    Returns:
      true if the -nowarn option should be used

  - ### createCompilerArg

    public Javac.ImplementationSpecificArgument createCompilerArg()
    Adds an implementation specific command-line argument.
    Returns:
      a ImplementationSpecificArgument to be configured

  - ### getCurrentCompilerArgs

    public String[] getCurrentCompilerArgs()
    Get the additional implementation specific command line arguments.
    Returns:
      array of command line arguments, guaranteed to be non-null.

  - ### setTempdir

    public void setTempdir(File tmpDir)
    Where Ant should place temporary files.
    Parameters:
      `tmpDir` - the temporary directory
    Since:
      Ant 1.6

  - ### getTempdir

    public File getTempdir()
    Where Ant should place temporary files.
    Returns:
      the temporary directory
    Since:
      Ant 1.6

  - ### setUpdatedProperty

    public void setUpdatedProperty(String updatedProperty)
    The property to set on compilation success. This property will not be set if the compilation fails, or if there are no files to compile.
    Parameters:
      `updatedProperty` - the property name to use.
    Since:
      Ant 1.7.1.

  - ### setErrorProperty

    public void setErrorProperty(String errorProperty)
    The property to set on compilation failure. This property will be set if the compilation fails.
    Parameters:
      `errorProperty` - the property name to use.
    Since:
      Ant 1.7.1.

  - ### setIncludeDestClasses

    public void setIncludeDestClasses(boolean includeDestClasses)
    This property controls whether to include the destination classes directory in the classpath given to the compiler. The default value is "true".
    Parameters:
      `includeDestClasses` - the value to use.

  - ### isIncludeDestClasses

    public boolean isIncludeDestClasses()
    Get the value of the includeDestClasses property.
    Returns:
      the value.

  - ### getTaskSuccess

    public boolean getTaskSuccess()
    Get the result of the javac task (success or failure).
    Returns:
      true if compilation succeeded, or was not necessary, false if the compilation failed.

  - ### createCompilerClasspath

    public Path createCompilerClasspath()
    The classpath to use when loading the compiler implementation if it is not a built-in one.
    Returns:
      Path
    Since:
      Ant 1.8.0

  - ### add

    public void add(CompilerAdapter adapter)
    Set the compiler adapter explicitly.
    Parameters:
      `adapter` - CompilerAdapter
    Since:
      Ant 1.8.0

  - ### setCreateMissingPackageInfoClass

    public void setCreateMissingPackageInfoClass(boolean b)
    Whether package-info.class files will be created by Ant matching package-info.java files that have been compiled but didn't create class files themselves.
    Parameters:
      `b` - boolean
    Since:
      Ant 1.8.3

  - ### execute

    public void execute() throws BuildException
    Executes the task.
    Overrides:
      `execute` in class `Task`
    Throws:
      `BuildException` - if an error occurs

  - ### resetFileLists

    protected void resetFileLists()
    Clear the list of files to be compiled and copied..

  - ### scanDir

    protected void scanDir(File srcDir, File destDir, String[] files)
    Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList
    Parameters:
      `srcDir` - The source directory
      `destDir` - The destination directory
      `files` - An array of filenames

  - ### getFileList

    public File[] getFileList()
    Gets the list of files to be compiled.
    Returns:
      the list of files as an array

  - ### isJdkCompiler

    protected boolean isJdkCompiler(String compilerImpl)
    Is the compiler implementation a jdk compiler
    Parameters:
      `compilerImpl` - the name of the compiler implementation
    Returns:
      true if compilerImpl is "modern", "classic", "javac1.1", "javac1.2", "javac1.3", "javac1.4", "javac1.5", "javac1.6", "javac1.7", "javac1.8", "javac1.9", "javac9" or "javac10+".

  - ### getSystemJavac

    protected String getSystemJavac()
    Returns:
      the executable name of the java compiler

  - ### setCompiler

    public void setCompiler(String compiler)
    Choose the implementation for this particular task.
    Parameters:
      `compiler` - the name of the compiler
    Since:
      Ant 1.5

  - ### getCompiler

    public String getCompiler()
    The implementation for this particular task.

    Defaults to the build.compiler property but can be overridden via the compiler and fork attributes.

    If fork has been set to true, the result will be extJavac and not classic or java1.2 - no matter what the compiler attribute looks like.

    Returns:
      the compiler.
    Since:
      Ant 1.5
    See Also:
      - `getCompilerVersion()`

  - ### getCompilerVersion

    public String getCompilerVersion()
    The implementation for this particular task.

    Defaults to the build.compiler property but can be overridden via the compiler attribute.

    This method does not take the fork attribute into account.

    Returns:
      the compiler.
    Since:
      Ant 1.5
    See Also:
      - `getCompiler()`

  - ### checkParameters

    protected void checkParameters() throws BuildException
    Check that all required attributes have been set and nothing silly has been entered.
    Throws:
      `BuildException` - if an error occurs
    Since:
      Ant 1.5

  - ### compile

    protected void compile()
    Perform the compilation.
    Since:
      Ant 1.5