java – How to run a spring boot app in intellij?

java – How to run a spring boot app in intellij?

Be sure to open the pom.xml and not the folder. IntelliJ will ask if you want to import as a project. Answer yes to this question.
You can always right-click on the pom.xml and choose Maven->Reimport which will do the classpath for you automatically.

Then you go to the main class from the tree and right-click and choose Run. That should create a temporary configuration in your run configurations.

The rest you can find here:

https://www.jetbrains.com/help/idea/running-applications.html

If you want to run as a maven project, go with this:

https://www.jetbrains.com/help/idea/work-with-maven-goals.html

If you want to run from terminal as java jar, when you have built your spring-boot-jar press CTRL+TAB+T (to activate terminal) and type in the terminal:
java -jar target/yourjar.jar

java – How to run a spring boot app in intellij?

Leave a Reply

Your email address will not be published. Required fields are marked *