This may be more a base Java question but I am not clear on how IntelliJ packages up a JAR file.
Currently I have a Java main class 'App' and I build an artifact that produces a .jar file that I run using 'java -jar app.jar'. This seems to work fine.
Now I want to create another Java main class for the sack of discussion I will call App2. I use IntelliJ to build another artifact that it seems to name app.App2. But when I look in the 'out' folder I still just see app.jar. My question is how do I change the java invocation to run this second Java main class? In other words 'java -jar app.jar' obviously needs to be ammended to indicate which of the 'main's will be executed. When I look at the MANIFEST that IntelliJ builds I see that the main class is the main inside of the original App class. Can this be overridded? Thank you for your help with this very basic question.