OS Manuals

/usr/lib/jvm/java-11-openjdk/bin/javac

From openjdk-11 11.0.33-r0 (os), captured 2026-11-05 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 or not 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-name>, -m <module-name>
        Compile only the specified module, 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
  --release <release>
        Compile for a specific VM version. Supported targets: 6, 7, 8, 9, 10, 11
  -s <directory>               Specify where to place generated source files
  -source <release>
        Provide source compatibility with specified release
  --source-path <path>, -sourcepath <path>
        Specify where to find input source files
  --system <jdk>|none          Override location of system modules
  -target <release>            Generate class files for specific VM version
  --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 (45)
OptionDescriptionSource
-Akey valueOptions to pass to annotation processorshelp
--add-modules module>(Root modules to resolve in addition to the initial modules, or all modules on the module path if <module> is ALL-MODULE-PATH.help
-d directorySets the destination directory for class files.help + man
-deprecationShows a description of each use or override of a deprecated member or class.help + man
--enable-previewEnable preview language features.help
-encoding encodingSets the source file encoding name, 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 ext directory.help + man
-gGenerates all debugging information, including local variables.help + man
-h directorySpecify where to place generated native header fileshelp
--help, -help, -?Prints a synopsis of standard options.help + man
--help-extra, -XDisplays information about nonstandard options and exits.help + man
-J flagPass <flag> directly to the runtime systemhelp
--limit-modules module>(Limit the universe of observable moduleshelp
--module-source-path module-source-pathSpecify where to find input source files for multiple moduleshelp
--module-version versionSpecify version of modules that are being compiledhelp
-nowarnDisables warning messages.help + man
-parametersStores formal parameter names of constructors and methods in the generated class file so that the method java.lang.reflect.Executable.getParameters from the Reflection API can retrieve them.help + man
-processor class1Names of the annotation processors to run;help
--processor-module-path pathSpecify a module path where to find annotation processorshelp
-profile profileWhen using compact profiles, this option specifies the profile name when compiling.help + man
--release releaseCompile for a specific VM version.help
-s directorySpecifies the directory where to place the generated source files.help + man
-source releaseProvide source compatibility with specified releasehelp + man
--system jdk>|noneOverride location of system moduleshelp
-target releaseGenerates class files that target a specified release of the virtual machine.help + man
--upgrade-module-path pathOverride location of upgradeable moduleshelp
-verboseUses verbose output, which includes information about each class loaded and each source file compiled.help + man
--version, -versionPrints release information.help + man
-WerrorTerminate compilation if warnings occurhelp
-cp, -classpath pathSpecifies where to find user class files, and (optionally) annotation processors and source files. (in the manual page but not in --help)man
-Djava.ext.dirs directoriesOverrides the location of installed extensions. (in the manual page but not in --help)man
-Djava.endorsed.dirs directoriesOverrides the location of the endorsed standards path. (in the manual page but not in --help)man
-JoptionPasses option to the Java Virtual Machine (JVM), where option is one of the options described on the reference page for the Java launcher. (in the manual page but not in --help)man
-processorpath pathSpecifies where to find annotation processors. (in the manual page but not in --help)man
-sourcepath sourcepathSpecifies the source code path to search for class or interface definitions. (in the manual page but not in --help)man
-werrorTerminates compilation when warnings occur. (in the manual page but not in --help)man
-bootclasspath bootclasspathCross-compiles against the specified set of boot classes. (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
-Xstdout filenameSends compiler messages to the named file. (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
Examples (33) from the manual page, untested

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