Java generates JAR packages with cmd (javac, jar) command line emulation IntelliJ idea software under window

Source: Internet
Author: User

@@ 首先 Most important cmd command: Javac, jar: Use the following ( note [.] Do not lose the wrong ):

1. Javac Compilation:

D:\myworkset\idea_hadoop>javac-d. \out\production-cp. \lib\*-encoding Utf-8 Src\com\it18zhang\hadoop\*.java

2.jar Packaging:

D:\myworkset\idea_hadoop>jar cvfm. \out\artifacts\idea_hadoop.jar. \out\production\meta-inf\manifest. Mf-c. \out\production\.

3. My IDEA code structure: simulates the Eclipse Common Java Project project:

@1:: d:\myworkset\idea_hadoop>javac-d. \out\production-cp.; \lib\*-encoding utf-8 Src\com\it18zhang\hadoop\*.java Command Description:

Description:-D. \out\production ======> represents the compilation of the output. Xx\xx\*.class directory and file storage location.

Description:-CP.;. \lib\* ======> Indicates the dependencies of other. Class-Stored directories (jar packages under Lib\)

Description:-encoding utf-8 Src\com\it18zhang\hadoop\*.java ======> in order to prevent comments in Chinese compilation error "Resolving Java" error: encoding GBK non-mapped characters "" and indicating the compiled source code Position.

@2::d:\myworkset\idea_hadoop>jar cvfm. \out\artifacts\idea_hadoop.jar. \out\production\meta-inf\manifest. Mf-c. \out\production\. Command Description:

Description: . \out\artifacts\idea_hadoop.jar ======> indicates the directory in which the output jar is stored

Description:. \out\production\meta-inf\manifest. The MF ======> represents the full path file main-class:com.it18zhang.hadoop.maxtemperature where the program entry Main method resides.

Note:\meta-inf\manifest. MF files are created manually and written to:

manifest-version:1.0
Main-class:com.it18zhang.hadoop.maxtemperature

Description: -C. \out\production\. ======> is where my class files and package paths are stored.

The above operation reference article:

Javac Reference https://www.ntu.edu.sg/home/ehchua/programming/java/J9c_PackageClasspath.html

Idea hit jar bag 56277138

CMD jar command line bottom jar Package Wrap Summary

Troubleshooting Java "Error: encoding GBK non-mapped characters"

Java generates JAR packages with cmd (javac, jar) command line emulation IntelliJ idea software under window

Related Article

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.