I imported a Spring Initializr build to IntelliJ and then run it as a Spring Boot build. The build works fine and displays in the browser but I continue to receive an error about unused imports and that @SpringBootApplication cannot be resolved. I also followed these steps as well: Cannot resolve symbol SpringApplication
Anyone else has this issue.
package com.sts.kevthedev;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class KevthedevApplication {
public static void main(String[] args) {
SpringApplication.run(KevthedevApplication.class, args);
}
}
Run your Spring Boot application and open the Services tool window: select View | Tool Windows | Services or press Alt+8 . Select your running Spring Boot application and open the Actuator tab.
IntelliJ IDEA creates a Spring Boot run configuration that you can use to run your new Spring application. If the run configuration is selected, press Shift+F10 . icon in the gutter of the SpringBootTutorialApplication. java file next to the class declaration or the main() method declaration.
Try it:
File -> Invalidate Caches/Restart -> Invalidate And Restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With