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
    • 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
    • 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
    • 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
    • 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
    • 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
    • processorPath

      public JavacOptions processorPath(File path)
      Specify where to find annotation processors
      Returns:
      this list of options
      Since:
      1.5.18
    • 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
    • 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
    • warningError

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