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