First of all I'm not able to produce a .jar with IntelliJ without using Artifacts and I don't understand why. I make my project, build it, run it, make module but none of that produce de .jar in out directory... Maybe the reason is that I never wait to then end of the run and always interrupt with alt+F2 because the program is very long to run entirely, it's a bot.
So then I try to produce .jar using Artifact function in IntelliJ but it produces a .jar that I can't run :
-java prgr.jar
returns Error: Could not find or load main class prgr.jar
and -java -jar prgr.jar
returns no main manifest attribute, in prgr.jar
So I got few questions given that my program runs perfectly when I run the main class from IntelliJ :
What is the difference between commands :
-java prgr.jar
and-java -jar prgr.jar
What is the MANIFEST.MF and how to use it ?
How can I do to produce a .jar that I can run from a shell ? How to use the artifact function properly, what files do I have to put and where in order to make it work ?
Edit : I just saw that I need the MANIFEST.MF but how do I tell the .jar where to find the MANIFEST ?