Javac[Options] [SourceFiles] The [@files] parameters can be arranged in any order.Optionscommand-line Options.SourceFilesOne or more source files to compile (for example, Myclass.java).@filesOne or more files that list the source files. First, view the command
| -G |
Generate all debugging information |
| -g:none |
Do not generate any debug information |
| -g:{lines,vars,source} |
Generate only some debugging information |
| -nowarn |
Do not generate any warnings |
| -verbose |
Output messages about the actions that the compiler is performing |
| -deprecation |
Output source location using outdated APIs |
| -classpath < paths > |
Specify where to find user class files |
| -CP < paths > |
Specify where to find user class files |
| -sourcepath < paths > |
Specify where to find the input source files |
| -bootclasspath < paths > |
Overwrite the location of the boot class file |
| -extdirs < catalogue > |
Overwrite the location of the installed extension directory |
| -endorseddirs < catalogue > |
The location of the standard path that overrides the signature |
| -D < directories > |
Specify the location where the generated class files are stored |
| -encoding < coding > |
Specify the character encoding used by the source file |
| -source < version > |
Provides source compatibility with a specified version |
| -target < version > |
To generate a class file for a specific VM version |
| -version |
Version information |
| -help |
Summary of Output Standard options |
| -X |
Output non-standard options for feeds |
| j< logo > |
Pass < flag > directly to the runtime system |
- D is to specify the output directoryFor example: javac-d./classes Helloworld.java means to place the Helloworld.java compiled bytecode file in the classes subdirectory of the current directory "note": ①: If the specified directory does not exist, Then the successful ② will not be created: if Helloworld.java has the package name and the package name is MyJava.study.day01, then the Helloworld.class file will be placed in: Current directory/classes/myjava/ Under the Study.day01/folder, automatically created if no path is changed
6, Javac command detailed