44

I want to create a .jar File using IntelliJ 2016.1

When I want to create a .jar file the Build Artifacts is deactivated.

Is there somthing i must change in my settings or is there somthing missing on my computer? Please help :)

I dont need help on how to create a JAR file.

SunflowerToadTheOrbiter
  • 1,285
  • 4
  • 15
  • 25

2 Answers2

79

It's likely that you haven't configured that you want to build a .JAR/Artifact.

If you go to to your Project Settings by doing:

Ctrl+Shift+Alt+S

and click on the Artifacts tab on the side.

Then click the Green + at the top, you'll be able to configure your project to build an artifact.

Then Build > Build Artifacts... should not be greyed out and your should be able to build your JAR.

Harmelodic
  • 5,682
  • 1
  • 28
  • 31
  • 1
    This isn't directed at you, but why doesn't Intellij set this automatically? Why do I keep having to add this same setting for each Java project I'm working on? Seems odd for an otherwise helpful IDE. – Mike B Mar 15 '20 at 21:54
  • Different projects require different configuration. You wouldn't configure a Spring Boot app using Gradle, in the same way as a Camel project using Maven. – Harmelodic Mar 26 '20 at 14:22
  • 1
    @mblakesley Agree with you. I have never clicked on "Add" in ProjectSettings any time to build an Artifact since everytime was build automatically and refreshed itself by IntellJ in every change of my POM version. Now is disappeared, and I have to do it manually. Don't understand why... – Aerox Sep 23 '20 at 21:09
  • @mblakesley Not able to edit my comment, but now I found the answer (at least in my case). Just "Reimport All Maven Projects" and they will come back again. – Aerox Sep 23 '20 at 21:38
2

In my case i solved this problem with;

Open pom.xml,

Right Click > Run Maven -> Reimport

After this, i was be able to Build Artifacts.

Ramazan Mutlu
  • 21
  • 1
  • 3