How to create a .jar file or export JAR in IntelliJ IDEA (like Eclipse Java archive export)?

JavaIntellij Idea

Java Problem Overview


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.

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

Java Solutions


Solution 1 - Java

For Intellij IDEA version 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.

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

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

Solution 2 - Java

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

Solution 3 - Java

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsungkwangsongView Question on Stackoverflow
Solution 1 - JavaBenView Answer on Stackoverflow
Solution 2 - JavaCrazyCoderView Answer on Stackoverflow
Solution 3 - JavadawezView Answer on Stackoverflow