Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intellij run configuration can't find spring boot class

I am trying to create a run configuration for a spring boot app, but Intellij can't find the main class of the spring boot app (Usually it is automatically populated). I tried adding the class by searching the project structure, but Intellij won't let me add that application's main file to 'Main class' of the configuration. How can I make Intellij detect the class?

Project Directory:

rootfolder
   > springBootBackEnd
   > angularUI

I have the module set to 'rootfolder' and the content root is the rootfolder

like image 232
matchi Avatar asked Dec 13 '17 14:12

matchi


People also ask

Why spring is not showing in IntelliJ?

Enable Spring support in IntelliJ IDEA This functionality is not available in IntelliJ IDEA Community Edition and IntelliJ IDEA Edu. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Open the Installed tab, search for Spring and make sure that the checkboxes next to all relevant plugins are selected.


2 Answers

Problem may be that you have badly configured IDEA project files.

Close IDEA, delete all .idea files and reimport project.

like image 195
MarekM Avatar answered Oct 16 '22 01:10

MarekM


The same issue occured to me. In my case, it was the project JDK that was not set. The module JDK was set, but not the project one.

Go to File > Project Structure > Project > Project SDK to solve the issue.

like image 27
Thomas Martin Avatar answered Oct 16 '22 01:10

Thomas Martin