IntelliJ IDEA packs Java projects built by Maven

Source: Internet
Author: User

Preface

IntelliJ IDEA compilation and generation of Jar packages are different from those of Eclipse. How to build this Maven Java recommendation engine project to generate a Jar package does indeed search for a lot of information, and there are successes and failures, this verification method is recorded and shared with friends who encounter such problems.

 

OS: Windows 8.1

JRE: 1.7.0

Development Tool: IntelliJ IDEA 13.1.1

 

1. Select the Java project name and selectFile->Project structure... Ctrl + Alt + Shift + S

 

 

2. In the pop-up window, select"Artifacts", Click"+"Select jar, and then select"From modules with dependencies".

 

 

3. Configure"Main Class".

 

 

After the configuration is complete, click OK to go to the next step.

 

 

4. Select"Build On make"(Jar is automatically output during the make project)

 

 

5. the above steps complete the configuration of generating the Jar package during compilation, and then selectBuild->Make project.

 

 

Run the Jar package in the project output directory and run the command to run the Jar file.

 

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.