如何在IntelliJ上创建.jar文件或导出jar(比如eclipse java archive export) [duplicate]

时间:2023-02-05 14:06:50

This question already has an answer here:

这个问题已经有了答案:

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 archive export)

3 个解决方案

#1


349  

For Intellij IDEA version 11.0.2

对于Intellij IDEA 11.0.2版本

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.

文件|项目结构|工件然后你应该按alt+insert或者点击+图标,然后从有依赖项的模块中创建新的工件选择——> jar——>。

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/

#2


48  

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

你没有具体说明你的想法。在9.0使用Build |构建jar之前,在IDEA 9.0中使用项目结构|构件。

#3


2  

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

在intellij8中,我使用的是一个特殊的插件“Jar工具”,它是可配置的,并且允许打包一个Jar存档文件。

#1


349  

For Intellij IDEA version 11.0.2

对于Intellij IDEA 11.0.2版本

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.

文件|项目结构|工件然后你应该按alt+insert或者点击+图标,然后从有依赖项的模块中创建新的工件选择——> jar——>。

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/

#2


48  

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

你没有具体说明你的想法。在9.0使用Build |构建jar之前,在IDEA 9.0中使用项目结构|构件。

#3


2  

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

在intellij8中,我使用的是一个特殊的插件“Jar工具”,它是可配置的,并且允许打包一个Jar存档文件。