Difference between "application" and "JAR application" in intelliJ idea

Viewed 525

I have a java program that was written by somebody else and I need to develop it further. They have used intelliJ idea and maven (neither of which I have used before and I am also new to java). I want to ideally build and run the program from a terminal instead of from the IDE.

I have found that apparently this should be done by creating a .jar application from within the IDE and then running that.

In the IntelliJ idea run/configurations window, there seems to be "applications" and also "JAR applications". When I build and run the program as an "application" from within the IDE it works and does not as a "JAR application".

I have tried to find out what the difference is between what is marked as an "application" and a "JAR application" in this window and can't find it anywhere. If anybody could shed some light on the subject, or who has managed to find an answer to this elsewhere then it would be great if you could give me the link.

If I could find out what the non-jar application is and run that from the terminal - at least that would give me something that works.

1 Answers

As the documentation goes , the application run configuration runs the main() method straight away (but I think @CrazyCoder cleared it out).

You can build from terminal with maven. For a quick start you can use this command in the maven project root:

mvn clean install -P[profile]

where profile is optional.

Then you can find the jar in the target folder.

Related