如何在IntelliJ IDEA中创建.jar文件或导出JAR(例如Eclipse Java归档文件导出)?

如何在IntelliJ IDEA中创建.jar文件或导出JAR(例如Eclipse Java归档文件导出)?

问题描述:

我正在使用IntelliJ IDEA IDE.我想从Java编译的类文件创建一个JAR文件.但是我没有找到命令或文件.

I was using IntelliJ IDEA IDE. I want to create a JAR file from Java compiled class files. But I didn't find a command or file.

如何创建一个JAR文件(就像在Eclipse中一样)?

How to create a JAR file (like it is done in Eclipse)?

对于Intellij IDEA 11.0.2版

文件|项目结构伪像那么您应该按 alt +插入或单击加号图标并创建新的工件,选择-> jar->从具有依赖性的模块中.

File | Project Structure | Artifacts then you should press alt+insert or click the plus icon and create new artifact choose --> jar --> From modules with dependencies.

下一步转到构建|构建工件->选择您的工件.

Next goto Build | Build artifacts --> choose your artifact.

来源: http://blogs.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/