6. javac commands and javac commands

Source: Internet
Author: User

6. javac commands and javac commands
Javac [options] [sourcefiles] [@ files] parameters can be arranged in any order. Options command line options. Sourcefiles one or more source files to be compiled (for example, MyClass. java ). @ Files one or more files listing source files. 1. View commands

-G Generate all debugging information
-G: none No debugging information is generated
-G: {lines, vars, source} Only some debugging information is generated.
-Nowarn No warning is generated
-Verbose Output the message about the operation being executed by the compiler.
-Deprecation Output the source location of the obsolete API
-Classpath <path> Specifies the location for searching user class files
-Cp <path> Specifies the location for searching user class files
-Sourcepath <path> Specifies the location of the Input Source file to be searched.
-Bootclasspath <path> Overwrite the location of the bootstrap File
-Extdirs <directory> Overwrite the location of the installed extension directory
-Endorseddirs <directory> Location that overwrites the standard path of the signature
-D <directory> Specifies the location where the generated class files are stored
-Encoding <encoding> Specifies the character encoding used by the source file.
-Source <version> Provides source compatibility with specified versions
-Target <version> Generate class files for specific VM versions
-Version Version Information
-Help Output overview of standard options
-X Output A summary of non-standard options
J <flag> Directly pass the <flag> to the runtime system
-D is used to specify the output directory.For example: javac-d. /classes HelloWorld. java means to put HelloWorld. place the compiled java bytecode file in the classes subdirectory of the current directory [note]: ①: if the specified directory does not exist, it will not be created successfully. ②: If HelloWorld. java has a package name named myJava. study. day01, then HelloWorld. the class file will be placed in the current directory/classes/myJava/study. in the day01/folder, if the path is not changed, it is automatically created.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.