About idea Export Project jar package/runnable jar

Source: Internet
Author: User

Export the project as a jar package divided into runnable jar and normal jar package

First, export to ordinary jar package

The jar package only has the project source code, JAVA-CP Wordcount.jar is used to run the ordinary jar package

1. Open File > Project Structure > Artifacts

2. Add a Artifact (+ > JAR > Empty)

3, enter the name of this jar (' Samplename '), name below the path generated by this jar package (Output directory),

4. Add module output to this Samplename.jar in output layout (+ > Module output or select the corresponding module double-click in the Available elements box)

5. Select the module of your project source file (Note: This is not the Web module of choice)

6. Then click OK to exit the project structure panel

7. Finally generate this jar (Build > Build artifacts ... > Samplename > Build/rebuild)

Second, export as executable jar package
There is not only source code in the jar package, but also a variety of dependent packages, Java-jar is used to run the Runable jar package

1, unlike the export of ordinary jar package is, in the second step to change Jar-->from modules with dependencies

2,. Configure "main class" in the Configuration window, select a Java class (with the Main method), and click the Ok,ok button when you are done. This completes the "Project Structure" setting.

3. Go back to the main menu of idea and choose "Build" or "Rebuild" under "build-build artifacts" to generate the final runnable jar.

About idea Export Project jar package/runnable jar

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.