1

I have a project whereby I can run it as an application from within intelliJ IDEA. However when packaging into a .jar I cannot run the created .jar

I think there may be something missing in my setup, but I can't work it out. I have read many answers already that do not resolve my problem

IntelliJ IDEA artifact settings are as follows:

enter image description here

Manifest file:

enter image description here

Artifact build result:

enter image description here

Error when running .jar file

enter image description here

The class does exist as I can run it comfortably from IntelliJ IDEA and see some of my System.out messages:

enter image description here

enter image description here

Royal Wares
  • 1,192
  • 10
  • 23
  • There are a number of ways to do this from Maven, q.v. the duplicate link. – Tim Biegeleisen Sep 24 '18 at 08:45
  • @TimBiegeleisen how does this help with generating the JAR from IntelliJ? That's a work around not a solution. – Royal Wares Sep 24 '18 at 08:49
  • Who says it is the job of IntelliJ to generate exeuctable JARs? – Tim Biegeleisen Sep 24 '18 at 08:51
  • @TimBiegeleisen The goal is to allow this process to be performed through intelliJ, what you have done is the equivalent of "My front door doesn't open", "Here's a key to the window, that's how you get in from now on". – Royal Wares Sep 24 '18 at 08:54
  • IntelliJ is not a build tool primarily, it is an IDE. If you want to any sort of complex build work with Java, then you should be using something like Maven (which you're already using), Gradle, etc. You asked how can you drive in a nail with a cell phone. My answer was, don't use a cell phone, use a hammer :-) – Tim Biegeleisen Sep 24 '18 at 09:00
  • Okay, I can understand your approach a little more now, however I think you've still misunderstood something. Your comparison to a cell phone is wildly out as IntelliJ DOES have an artefact builder - if your comment had addressed this to say something along the lines of "It's a known limitation of IntelliJ that it can't do that" I could have gone along with it, however it seems like you don't understand the IntelliJ software and have instead pushed the solution you're comfortable with. It's more like this problem is a screw and you want to hit it with a hammer. – Royal Wares Sep 24 '18 at 09:09
  • @TimBiegeleisen and also you want to tell me the problem is a nail, when really it was a screw. – Royal Wares Sep 24 '18 at 09:10
  • @TimBiegeleisen thanks, happy to hear that - much appreciated. – Royal Wares Sep 24 '18 at 09:13

0 Answers0