Class JavacOptions

All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, List<String>, RandomAccess

public class JavacOptions extends ArrayList<String>
Options for the standard javac tool.
Since:
1.5.18
See Also:
  • Constructor Details

    • JavacOptions

      public JavacOptions()
  • Method Details

    • annotationOption

      public JavacOptions annotationOption(String key, String value)
      Option to pass to annotation processors
      Returns:
      this list of options
      Since:
      1.5.18
    • addModules

      public JavacOptions addModules(String... modules)
      Root modules to resolve in addition to the initial modules, or all modules on the module path if a module is ALL-MODULE-PATH.
      Returns:
      this list of options
      Since:
      1.5.18
    • addModules

      public JavacOptions addModules(List<String> modules)
      Root modules to resolve in addition to the initial modules, or all modules on the module path if a module is ALL-MODULE-PATH.
      Returns:
      this list of options
      Since:
      1.5.18
    • encoding

      public JavacOptions encoding(String name)
      Specify character encoding used by source files
      Returns:
      this list of options
      Since:
      1.5.18
    • deprecation

      public JavacOptions deprecation()
      Output source locations where deprecated APIs are used
      Returns:
      this list of options
      Since:
      1.5.18
    • enablePreview

      public JavacOptions enablePreview()
      Enable preview language features. To be used in conjunction with release(int).
      Returns:
      this list of options
      Since:
      1.5.18
    • endorsedDirs

      public JavacOptions endorsedDirs(File... dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      1.5.18
    • endorsedDirs

      public JavacOptions endorsedDirs(List<File> dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      1.5.18
    • endorsedDirs

      public JavacOptions endorsedDirs(Path... dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      2.1
    • endorsedDirsPaths

      public JavacOptions endorsedDirsPaths(List<Path> dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      2.1
    • endorsedDirs

      public JavacOptions endorsedDirs(String... dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      2.1
    • endorsedDirsStrings

      public JavacOptions endorsedDirsStrings(List<String> dirs)
      Override location of endorsed standards path
      Returns:
      this list of options
      Since:
      2.1
    • extDirs

      public JavacOptions extDirs(File... dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      1.5.18
    • extDirs

      public JavacOptions extDirs(List<File> dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      1.5.18
    • extDirs

      public JavacOptions extDirs(Path... dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      2.1
    • extDirsPaths

      public JavacOptions extDirsPaths(List<Path> dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      2.1
    • extDirs

      public JavacOptions extDirs(String... dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      2.1
    • extDirsStrings

      public JavacOptions extDirsStrings(List<String> dirs)
      Override location of installed extensions
      Returns:
      this list of options
      Since:
      2.1
    • containsRelease

      public boolean containsRelease()
      Indicates whether the Java SE release was set.
      Returns:
      true if the release was set; or false otherwise
      Since:
      1.5.18
    • release

      public JavacOptions release(int version)
      Compile for the specified Java SE release.
      Returns:
      this list of options
      Since:
      1.5.18
    • debuggingInfo

      public JavacOptions debuggingInfo(JavacOptions.DebuggingInfo option)
      Generate debugging info
      Returns:
      this list of options
      Since:
      1.5.18
    • nativeHeaders

      public JavacOptions nativeHeaders(File path)
      Specify where to place generated native header files
      Returns:
      this list of options
      Since:
      1.5.18
    • nativeHeaders

      public JavacOptions nativeHeaders(Path path)
      Specify where to place generated native header files
      Returns:
      this list of options
      Since:
      2.1
    • nativeHeaders

      public JavacOptions nativeHeaders(String path)
      Specify where to place generated native header files
      Returns:
      this list of options
      Since:
      2.1
    • implicit

      public JavacOptions implicit(JavacOptions.Implicit option)
      Specify whether or not to generate class files for implicitly referenced files
      Returns:
      this list of options
      Since:
      1.5.18
    • limitModules

      public JavacOptions limitModules(String... modules)
      Limit the universe of observable modules
      Returns:
      this list of options
      Since:
      1.5.18
    • limitModules

      public JavacOptions limitModules(List<String> modules)
      Limit the universe of observable modules
      Returns:
      this list of options
      Since:
      1.5.18
    • module

      public JavacOptions module(String... modules)
      Compile only the specified module(s), check timestamps
      Returns:
      this list of options
      Since:
      1.5.18
    • module

      public JavacOptions module(List<String> modules)
      Compile only the specified module(s), check timestamps
      Returns:
      this list of options
      Since:
      1.5.18
    • modulePath

      public JavacOptions modulePath(File... paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      1.5.18
    • modulePath

      public JavacOptions modulePath(List<File> paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      1.6.2
    • modulePath

      public JavacOptions modulePath(Path... paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      2.1
    • modulePathPaths

      public JavacOptions modulePathPaths(List<Path> paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      2.1
    • modulePath

      public JavacOptions modulePath(String... paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      2.1
    • modulePathStrings

      public JavacOptions modulePathStrings(List<String> paths)
      Specify where to find application modules
      Returns:
      this list of options
      Since:
      2.1
    • moduleSourcePath

      public JavacOptions moduleSourcePath(File path)
      Specify where to find input source files for multiple modules
      Returns:
      this list of options
      Since:
      1.5.18
    • moduleSourcePath

      public JavacOptions moduleSourcePath(Path path)
      Specify where to find input source files for multiple modules
      Returns:
      this list of options
      Since:
      2.1
    • moduleSourcePath

      public JavacOptions moduleSourcePath(String path)
      Specify where to find input source files for multiple modules
      Returns:
      this list of options
      Since:
      2.1
    • moduleVersion

      public JavacOptions moduleVersion(String version)
      Specify version of modules that are being compiled
      Returns:
      this list of options
      Since:
      1.5.18
    • noWarn

      public JavacOptions noWarn()
      Generate no warnings
      Returns:
      this list of options
      Since:
      1.5.18
    • parameters

      public JavacOptions parameters()
      Generate metadata for reflection on method parameters
      Returns:
      this list of options
      Since:
      1.5.18
    • process

      public JavacOptions process(JavacOptions.Processing option)
      Control whether annotation processing and/or compilation is done.
      Returns:
      this list of options
      Since:
      1.5.18
    • processors

      public JavacOptions processors(String... classnames)
      Names of the annotation processors to run; bypasses default discovery process
      Returns:
      this list of options
      Since:
      1.5.18
    • processors

      public JavacOptions processors(List<String> classnames)
      Names of the annotation processors to run; bypasses default discovery process
      Returns:
      this list of options
      Since:
      1.5.18
    • processorModulePath

      public JavacOptions processorModulePath(File path)
      Specify a module path where to find annotation processors
      Returns:
      this list of options
      Since:
      1.5.18
    • processorModulePath

      public JavacOptions processorModulePath(Path path)
      Specify a module path where to find annotation processors
      Returns:
      this list of options
      Since:
      2.1
    • processorModulePath

      public JavacOptions processorModulePath(String path)
      Specify a module path where to find annotation processors
      Returns:
      this list of options
      Since:
      2.1
    • processorPath

      public JavacOptions processorPath(File path)
      Specify where to find annotation processors
      Returns:
      this list of options
      Since:
      1.5.18
    • processorPath

      public JavacOptions processorPath(Path path)
      Specify where to find annotation processors
      Returns:
      this list of options
      Since:
      2.1
    • processorPath

      public JavacOptions processorPath(String path)
      Specify where to find annotation processors
      Returns:
      this list of options
      Since:
      2.1
    • profile

      public JavacOptions profile(String profile)
      Check that API used is available in the specified profile
      Returns:
      this list of options
      Since:
      1.5.18
    • sourceOutput

      public JavacOptions sourceOutput(String path)
      Specify the directory used to place the generated source files.
      Parameters:
      path - the source output directory path
      Returns:
      the list of options
      Since:
      2.1.1
    • sourceOutput

      public JavacOptions sourceOutput(File path)
      Specify the directory used to place the generated source files.
      Parameters:
      path - the source output directory path
      Returns:
      the list of options
      Since:
      2.1.1
    • sourceOutput

      public JavacOptions sourceOutput(Path path)
      Specify the directory used to place the generated source files.
      Parameters:
      path - the source output directory path
      Returns:
      the list of options
      Since:
      2.1.1
    • system

      public JavacOptions system(String option)
      Override location of system modules. Option is <jdk> or none.
      Returns:
      this list of options
      Since:
      1.5.18
    • upgradeModulePath

      public JavacOptions upgradeModulePath(File path)
      Override location of upgradeable modules
      Returns:
      this list of options
      Since:
      1.5.18
    • upgradeModulePath

      public JavacOptions upgradeModulePath(Path path)
      Override location of upgradeable modules
      Returns:
      this list of options
      Since:
      2.1
    • upgradeModulePath

      public JavacOptions upgradeModulePath(String path)
      Override location of upgradeable modules
      Returns:
      this list of options
      Since:
      2.1
    • warningError

      public JavacOptions warningError()
      Terminate compilation if warnings occur
      Returns:
      this list of options
      Since:
      1.5.18