How to build JARs from IntelliJ IDEA properly?


File -> Project Structure -> Project Settings -> Artifacts -> Click + (plus sign) -> Jar -> From modules with dependencies...

Select a Main Class (the one with main() method) if you need to make the jar runnable.

Select Extract to the target Jar

Click OK

Click Apply/OK

The above sets the “skeleton” to where the jar will be saved to. To actually build and save it do the following:

Build -> Build Artifact -> Build

Try Extracting the .jar file from:

 â”— đź“‚out
   â”— đź“‚artifacts
     â”— đź“‚ProjectName_jar
        â”— đź“śProjectName.jar


  • (Aug 2010) (Here’s how to build a jar with IntelliJ 10)
  • (Mar 2023)

Leave a Comment