如何在 IntelliJ 上创建 .jar 文件或导出 jar(如 eclipse java 存档导出)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2025607/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:44:12  来源:igfitidea点击:

How to create a .jar file or export jar on IntelliJ (like eclipse java archive export)

javaintellij-idea

提问by sungkwangsong

I was using IntelliJ-IDEA IDE , I want to create a jar file from java compiled class files. but I not found command or file, How to create a jar file (like eclipse java archive export)

我正在使用 IntelliJ-IDEA IDE,我想从 java 编译的类文件创建一个 jar 文件。但我没有找到命令或文件,如何创建 jar 文件(如 eclipse java 存档导出)

回答by CrazyCoder

You didn't specify your IDEA version. Before 9.0 use Build | Build Jars, in IDEA 9.0 use Project Structure | Artifacts.

您没有指定您的 IDEA 版本。9.0 之前使用Build | Build Jars,在IDEA 9.0 中使用Project Structure | 文物

回答by dawez

In intellij8 I was using a specific plugin "Jar Tool" that is configurable and allows to pack a JAR archive.

在 intellij8 中,我使用了一个特定的插件“Jar Tool”,它是可配置的并允许打包 JAR 档案。

回答by Ben

For Intellij IDEA version 11.0.2

对于 Intellij IDEA 版本 11.0.2

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

档案 | 项目结构 | Artifacts然后您应该按alt+insert或单击加号图标并创建新的工件选择 --> jar --> From modules with dependencies。

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

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

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

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