Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Resolve Symbol @SpringBootApplication - IntelliJ DEA

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);
    }
}
like image 773
Kevin Summersill Avatar asked Oct 03 '18 18:10

Kevin Summersill


People also ask

How do I run Springbootapplication in IntelliJ?

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.

Can we use Spring Boot in IntelliJ?

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.


1 Answers

Try it:
File -> Invalidate Caches/Restart -> Invalidate And Restart

like image 170
B_Osipiuk Avatar answered Sep 18 '22 15:09

B_Osipiuk