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