Intellijidea Export Java executable jar package

Source: Internet
Author: User

Original: IntelliJ idea export Java executable jar package

to ensure that their Java code is not a problem, in idea inside can be run normally, then, follow the following steps:

Open File - - Project Structure -artifacts, such as

Idea Export Java executable jar package "title=" IntelliJ idea export java executable jar Package ">

Click on the " + ", select" jar ", select empty or from the modules with dependencies, which will unpack the Jar package used in the project as part of the project, Packaged in the final jar package. However, there is a problem, that is, if the jar package referenced in the project is signed, the last packaged jar package runs with an error:

"Java.lang.SecurityException: Invalid signature file Digest for Manifest main attributes "

Therefore, the author chooses empty, and then in the " Output Layout", the files and folders that I want to package to add in. For externally referenced packages, the author is all placed in the Lib directory, so in class path, the dependent jar package is added, for example:

Lib/javax.servlet-3.0.0.v201112011016.jar lib/jetty-all-9.1.5.v20140505.jar lib/ Json-simple-1.1.1.jar

Set the main Class, so you don't have to say more.

Click OK.

Go back to Idea and choose Build---build artifacts to successfully build the jar package. The generated jar package is located in the set output directory.

Use the command java -jar Xxxxx.jar to execute the jar package.

Above.

IntelliJ idea export Java executable jar package

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.