OS Manuals

/usr/lib/jvm/java-21-amazon-corretto/bin/javac

Amazon Corretto 21 is a no-cost, multi-platform, production-ready distribution of OpenJDK 21

From corretto-21 21.0.13.0.11-r0 (enterprise-packages), captured 2026-11-08 by running javac --help (exit 0). permalink

Usage: javac <options> <source files>
where possible options include:
  @<filename>                  Read options and filenames from file
  -Akey[=value]                Options to pass to annotation processors
  --add-modules <module>(,<module>)*
        Root modules to resolve in addition to the initial modules,
        or all modules on the module path if <module> is ALL-MODULE-PATH.
  --boot-class-path <path>, -bootclasspath <path>
        Override location of bootstrap class files
  --class-path <path>, -classpath <path>, -cp <path>
        Specify where to find user class files and annotation processors
  -d <directory>               Specify where to place generated class files
  -deprecation
        Output source locations where deprecated APIs are used
  --enable-preview
        Enable preview language features.
        To be used in conjunction with either -source or --release.
  -encoding <encoding>         Specify character encoding used by source files
  -endorseddirs <dirs>         Override location of endorsed standards path
  -extdirs <dirs>              Override location of installed extensions
  -g                           Generate all debugging info
  -g:{lines,vars,source}       Generate only some debugging info
  -g:none                      Generate no debugging info
  -h <directory>
        Specify where to place generated native header files
  --help, -help, -?            Print this help message
  --help-extra, -X             Print help on extra options
  -implicit:{none,class}
        Specify whether to generate class files for implicitly referenced files
  -J<flag>                     Pass <flag> directly to the runtime system
  --limit-modules <module>(,<module>)*
        Limit the universe of observable modules
  --module <module>(,<module>)*, -m <module>(,<module>)*
        Compile only the specified module(s), check timestamps
  --module-path <path>, -p <path>
        Specify where to find application modules
  --module-source-path <module-source-path>
        Specify where to find input source files for multiple modules
  --module-version <version>
        Specify version of modules that are being compiled
  -nowarn                      Generate no warnings
  -parameters
        Generate metadata for reflection on method parameters
  -proc:{none,only,full}
        Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]
        Names of the annotation processors to run;
        bypasses default discovery process
  --processor-module-path <path>
        Specify a module path where to find annotation processors
  --processor-path <path>, -processorpath <path>
        Specify where to find annotation processors
  -profile <profile>
        Check that API used is available in the specified profile.
        This option is deprecated and may be removed in a future release.
  --release <release>
        Compile for the specified Java SE release.
        Supported releases:
            8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
  -s <directory>               Specify where to place generated source files
  --source <release>, -source <release>
        Provide source compatibility with the specified Java SE release.
        Supported releases:
            8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
  --source-path <path>, -sourcepath <path>
        Specify where to find input source files
  --system <jdk>|none          Override location of system modules
  --target <release>, -target <release>
        Generate class files suitable for the specified Java SE release.
        Supported releases:
            8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
  --upgrade-module-path <path>
        Override location of upgradeable modules
  -verbose                     Output messages about what the compiler is doing
  --version, -version          Version information
  -Werror                      Terminate compilation if warnings occur
Options (57)
OptionDescriptionSource
-Akey valueSpecifies options to pass to annotation processors.help + man
--add-modules module>(Specifies root modules to resolve in addition to the initial modules, or all modules on the module path if module is ALL-MODULE-PATH.help + man
-d directorySets the destination directory (or class output directory) for class files.help + man
-deprecationShows a description of each use or override of a deprecated member or class.help + man
--enable-previewEnables preview language features.help + man
-encoding encodingSpecifies character encoding used by source files, such as EUC-JP and UTF-8.help + man
-endorseddirs dirsOverrides the location of the endorsed standards path.help + man
-extdirs dirsOverrides the location of the installed extensions.help + man
-gGenerates all debugging information, including local variables.help + man
-h directorySpecifies where to place generated native header files.help + man
--help, -help, -?Prints a synopsis of the standard options.help + man
--help-extra, -XPrints a synopsis of the set of extra options.help + man
-J flagPass <flag> directly to the runtime systemhelp
--limit-modules module>(Limits the universe of observable modules.help + man
--module-source-path module-source-pathSpecifies where to find source files when compiling code in multiple modules.help + man
--module-version versionSpecifies the version of modules that are being compiled.help + man
-nowarnDisables warning messages.help + man
-parametersGenerates metadata for reflection on method parameters.help + man
-processor class1Names of the annotation processors to run;help + man
--processor-module-path pathSpecifies the module path used for finding annotation processors.help + man
-profile profileChecks that the API used is available in the specified profile.help + man
--release releaseCompiles source code according to the rules of the Java programming language for the specified Java SE release, generating class files which target that release.help + man
-s directorySpecifies the directory used to place the generated source files.help + man
--system jdk>|noneOverrides the location of system modules.help + man
--upgrade-module-path pathOverrides the location of upgradeable modules.help + man
-verboseOutputs messages about what the compiler is doing.help + man
--version, -versionPrints version information.help + man
-WerrorTerminates compilation when warnings occur.help + man
--boot-class-path, -bootclasspath pathOverrides the location of the bootstrap class files. (in the manual page but not in --help)man
--class-path, -classpath, -cp pathSpecifies where to find user class files and annotation processors. (in the manual page but not in --help)man
--help-lintPrints the supported keys for the -Xlint option. (in the manual page but not in --help)man
-implicit noneSpecifies whether or not to generate class files for implicitly referenced files: (in the manual page but not in --help)man
-JoptionPasses option to the runtime system, where option is one of the Java options described on java command. (in the manual page but not in --help)man
--module, -m module-nameCompiles those source files in the named modules that are newer than the corresponding files in the output directory. (in the manual page but not in --help)man
--module-path, -p pathSpecifies where to find application modules. (in the manual page but not in --help)man
-proc noneControls whether annotation processing and compilation are done. (in the manual page but not in --help)man
--processor-path, -processorpath pathSpecifies where to find annotation processors. (in the manual page but not in --help)man
--source, -source releaseCompiles source code according to the rules of the Java programming language for the specified Java SE release. (in the manual page but not in --help)man
--source-path, -sourcepath pathSpecifies where to find source files. (in the manual page but not in --help)man
--target, -target releaseGenerates class files suitable for the specified Java SE release. (in the manual page but not in --help)man
--add-exports module/package=other-module(Specifies a package to be considered as exported from its defining module to additional modules or to all unnamed modules when the value of other-module is ALL-UNNAMED. (in the manual page but not in --help)man
--add-reads module=other-module(Specifies additional modules to be considered as required by a given module. (in the manual page but not in --help)man
--default-module-for-created-files module-nameSpecifies the fallback target module for files created by annotation processors, if none is specified or inferred. (in the manual page but not in --help)man
-Djava.endorsed.dirs dirsOverrides the location of the endorsed standards path. (in the manual page but not in --help)man
-Djava.ext.dirs dirsOverrides the location of installed extensions. (in the manual page but not in --help)man
--patch-module module=pathOverrides or augments a module with classes and resources in JAR files or directories. (in the manual page but not in --help)man
-Xdiags compactSelects a diagnostic mode. (in the manual page but not in --help)man
-XdoclintEnables recommended checks for problems in documentation comments. (in the manual page but not in --help)man
-XlintEnables all recommended warnings. (in the manual page but not in --help)man
-Xmaxerrs numberSets the maximum number of errors to print. (in the manual page but not in --help)man
-Xmaxwarns numberSets the maximum number of warnings to print. (in the manual page but not in --help)man
-Xpkginfo alwaysSpecifies when and how the javac command generates package-info.class files from package-info.java files using one of the following options: (in the manual page but not in --help)man
-Xprefer sourceSpecifies which file to read when both a source file and class file are found for an implicitly compiled class using one of the following options. (in the manual page but not in --help)man
-XprintPrints a textual representation of specified types for debugging purposes. (in the manual page but not in --help)man
-XprintProcessorInfoPrints information about which annotations a processor is asked to process. (in the manual page but not in --help)man
-XprintRoundsPrints information about initial and subsequent annotation processing rounds. (in the manual page but not in --help)man
-Xstdout filenameSends compiler messages to the named file. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.