Instructions:

FileProject StructureProject SettingsArtifacts → Click + (plus sign) → JarFrom modules with dependencies...

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

Select Extract to the target Jar

Click OK

Click Apply/OK

The above sets the "skeleton" to where the JAR file will be saved to. To actually build and save it do the following:

BuildBuild ArtifactBuild

Try Extracting the .jar file from:

📦ProjectName
 ┗ 📂out
   ┗ 📂artifacts
     ┗ 📂ProjectName_jar
        ┗ 📜ProjectName.jar

References:

  • (Aug 2010) Quickly create a JAR artifact for an application (Here's how to build a JAR file with IntelliJ IDEA 10)
  • (Mar 2023) Package an application into a JAR
🌐
JetBrains
jetbrains.com › help › idea › compiling-applications.html
Compile and build applications with IntelliJ IDEA | IntelliJ IDEA Documentation
Open the Project Structure dialog (File | Project Structure Ctrl+Alt+Shift+S). In Project Settings, select Project and in the Project compiler output field, specify the corresponding path.
Discussions

java - How can I build JAR files from IntelliJ IDEA properly? - Stack Overflow
I have a project that contains a single module, and some dependencies. I'd like to create a JAR file, in a separate directory, that contains the compiled module. In addition, I would like to have the More on stackoverflow.com
🌐 stackoverflow.com
How to show build directory in IntelliJ IDEA - Stack Overflow
I build my project and on the file system I see the build directory but in IntelliJ IDEA 13.01 I see: How to make IntelliJ to show it like in Eclipse More on stackoverflow.com
🌐 stackoverflow.com
Intellij IDEA: How to change build directory? - Stack Overflow
Does anyone happen to know how to change the build directory name in Intellij IDEA (11 or 12)? The default name is out, I want it to be target. ... Save this answer. ... Show activity on this post. ... File [Menu] > Project Structure > Modules [List] > Path [Tab] > Use module compile output ... More on stackoverflow.com
🌐 stackoverflow.com
How do you work with IntelliJ IDEA and sbt?

I agree that the default Intellij Scala experience isn't as nice as it can be. There are two big big directions you can go to make it a lot nicer:

Currently I find myself switching between these two methods depending on what I'm doing

Below instructions assume Intellij 2020.1 or later

Use SBT Shell

Instructions:

  • Open the project as a SBT project

  • In File | Settings | Build, Execution, Deployment | Build Tools | sbt, tick all of Download - 'Library Sources', 'SBT sources' and Use SBT shell 'for imports', 'for builds'

  • Refresh the project

You should see a SBT shell tool window with an embedded SBT running inside. If you try to compile the project (Ctrl-F9) you'll see that SBT is doing the compile.

You can click on any of the compile errors and then press Ctrl-Shift-Up/Down to navigate between errors (much like how you navigate between search results). Just note that you need to click on one error first before the hotkeys will work

Pros:

  • Keeps compiler hot

  • Can run SBT tasks without starting a separate SBT

Cons:

  • Errors are hard to read

  • No SBT completion

  • Sometimes killing the SBT shell doesn't kill the process

Bloop & BSP

BSP / Bloop stability has improved significantly since 2020.1 and I've been pretty happy with it

Instructions:

  • Delete .idea and use File | Open to open your project. Choose BSP project when asked

  • You should see

I personally turn off 'File | Settings | Build, Execution, Deployment | Build Tools | BSP | export SBT projects to bloop before import' and choose to run sbt bloopImport myself as I often have SBT running anyway

Pros:

  • Faster compiles

  • Better compile error UI (more integrated than just a console window)

  • You can run tests in watch mode in another terminal window and the compilation is automatically deduplicated

Cons:

  • Need to start SBT to run anything other than compile / test (e.g. coverage)

  • No IDE help when editing build.sbt

Why not both

This is my script to switch between BSP and SBT project

#! /bin/bash

# Switch Intellij projects from sbt to bsp (and vice versa)

if [[ -d .idea ]]
then
  if [[ -d .ideas ]]
  then 
    mv .idea .ideab && mv .ideas .idea
  elif [[ -d .ideab ]]
  then
    mv .idea .ideas && mv .ideab .idea
  else
    # Preparing for bsp project
    mv .idea .ideas
  fi
fi
More on reddit.com
🌐 r/scala
6
1
May 14, 2020
🌐
JetBrains
jetbrains.com › help › idea › build-sync-tool-window.html
Build tool window | IntelliJ IDEA Documentation
October 8, 2024 - The Build tool window helps you view the output of your builds that were done by IntelliJ IDEA, delegated to Maven or Gradle, and the results of the project synchronization.
Top answer
1 of 16
840

Instructions:

FileProject StructureProject SettingsArtifacts → Click + (plus sign) → JarFrom modules with dependencies...

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

Select Extract to the target Jar

Click OK

Click Apply/OK

The above sets the "skeleton" to where the JAR file will be saved to. To actually build and save it do the following:

BuildBuild ArtifactBuild

Try Extracting the .jar file from:

📦ProjectName
 ┗ 📂out
   ┗ 📂artifacts
     ┗ 📂ProjectName_jar
        ┗ 📜ProjectName.jar

References:

  • (Aug 2010) Quickly create a JAR artifact for an application (Here's how to build a JAR file with IntelliJ IDEA 10)
  • (Mar 2023) Package an application into a JAR
2 of 16
387

This is still an issue in 2017. I hope it will help somebody out there!

I found two possibilities to create working JAR files under IntelliJ 2017.2

1. Creating an artifact from IntelliJ:

  • Go to project structure:

  • Create a new artifact:

  • Select the main class, and be sure to change the manifest folder:

You have to change manifest directory:

<project folder>\src\main\java

Replace "java" with "resources"

<project folder>\src\main\resources

This is how it should look like:

  • Then you choose the dependencies what you want to be packed in your JAR file, or near your JAR file

  • To build your artifact, go to build artifacts and choose "rebuild". It will create an "out" folder with your JAR file and its dependencies.

2. Using maven-assembly-plugin

Add a build section to the POM file

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <finalName>ServiceCreate</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <archive>
                        <manifest>
                            <mainClass>com.svt.optimoo.App</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
  • Create a new run/debug configuration:

  • Choose an application:

  • Fill in the form
  • Add the "assembly:single" Maven goal after the build to be executed last

  • Save it, and then run

This procedure will create the JAR file under the "target" folder

Author: JetBrains
🌐
JetBrains
jetbrains.com › help › idea › build-file-properties.html
Ant build file properties - IntelliJ IDEA
March 3, 2023 - You will be redirected shortly · Redirecting… · Click here if you are not redirected
🌐
JetBrains
jetbrains.com › guide › java › tutorials › working-with-gradle › the-build-gradle-file
The build.gradle file - JetBrains Guide
February 17, 2023 - Note that IntelliJ IDEA uses the updated configuration names for the dependencies, for example testImplementation instead of testCompile. It also uses the compact form for dependency declaration, with the group name, artifact name and version number separated by colons. In order for Gradle to run JUnit 5 tests, the test section of the build.gradle.kts file needs to say useJUnitPlatform, so IntelliJ IDEA has generated this for us too.
Find elsewhere
🌐
JetBrains
jetbrains.com › help › idea › build-overview.html
Build actions overview | IntelliJ IDEA Documentation
February 11, 2024 - Go to Build | Build Project. Alternatively, press Ctrl+F9 to build your project. IntelliJ IDEA compiles all the classes inside your build target and places them inside the output directory.
🌐
Baeldung
baeldung.com › home › ide › intellij idea – how to build project automatically
Intellij Idea – How to Build Project Automatically | Baeldung
February 19, 2026 - To enable automatic builds, we can change the settings in IntelliJ IDEA by navigating to File > Settings:
🌐
JetBrains
jetbrains.com › help › idea › creating-and-running-your-first-java-application.html
Create your first Java application | IntelliJ IDEA Documentation
August 7, 2026 - In the Project tool window, you can now see the MANIFEST.MF file. This file has metadata about your JAR, such as the main class to run. In the main menu, go to Build | Build Artifacts.
🌐
Medium
youngstone89.medium.com › how-to-build-an-artifact-from-simple-java-application-project-in-intellij-3adde590dffe
How to build an artifact from simple java application project in IntelliJ? | by 김영석 | Medium
September 13, 2020 - You can find the button in right-click menu or Build menu at the top. What the Recompile does is to compile the java file into class file into the output directory. ... as you can see the compiled Main.class file resides in out/production/SimpleApplication folder. That is because IntelliJ basically follows the output directory rules as followings:
🌐
TutorialsPoint
tutorialspoint.com › intellij_idea › intellij_idea_build_tools.htm
Intellij Idea − Build Tools
IntelliJ provides a way to build and package Java package. It supports external build tools like Maven and Gradle. This chapter discusses about these build tools. ... Navigate to File → Project.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › view-dependencies › build-tool-window
Build tool window - JetBrains Guide
February 17, 2023 - Alternatively, we can open it by using Recent Files, ⌘E (macOS) / Ctrl+E (Windows/Linux), and typing "gradle" or "maven", or the name of your build system. The Build tool window shows you each IntelliJ IDEA module separately, and each module’s "Dependencies" folder shows you all your ...
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360009909039-How-do-I-add-a-build-Path-to-a-class-folder
How do I add a build Path to a class folder? – IDEs Support (IntelliJ Platform) | JetBrains
November 18, 2020 - From the main menu, go to File | Project Structure (CTRL+SHIFT+ALT+S on Windows/Linux, ⌘+; on Mac OS X) and select the Modules section. Switch to the Dependencies tab and click + at the bottom of the dialog.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 8697389335442-Working-with-build-folders
Working with build folders – IDEs Support (IntelliJ Platform) | JetBrains
November 22, 2022 - So, there are quite a few files I have edited. Since more or less files are going through a build process, the production files will be in /build/index.html or /build/css/main.css /build/img/main/hero.jpg and so on.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › hello-world › packaging-the-application
Packaging the Application - JetBrains Guide
October 23, 2024 - IntelliJ IDEA will show you a list of classes in your project, you only have one so press OK or double click to select it. All the other defaults are fine for this tutorial, press OK. Now you can see your new JAR file defined in the Project Structure dialog. If it matches the above screenshot, press OK. You have now defined how to build ...
🌐
Kotlin
kotlinlang.org › docs › jvm-get-started.html
Create a console app – tutorial | Kotlin Documentation
March 16, 2026 - In IntelliJ IDEA, select File | New | Project. In the list on the left, select Kotlin. Name the new project and change its location if necessary. Select the Create Git repository checkbox to place the new project under version control.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 207013365-Can-t-find-the-Build-File-Properties-dialog-box-Help
Can't find the "Build File Properties" dialog box, Help – IDEs Support (IntelliJ Platform) | JetBrains
But I think there is another dialog box called "Build File Properties" dialog box, but I can't find where it is located. Do u know where it is ?? Kindly let me know. ... The dialog is available from the "Ant Build" toolwindow (alt-Enter, toolbar button or context popup menu). -- Best regards, Eugene Zhuravlev JetBrains, Inc, http://www.intellij.com "Develop with pleasure!"