“The import org.springframework cannot be resolved.”

后端 未结 17 626
傲寒
傲寒 2020-12-13 12:44

Here is my POM.xml file:


    
        1.6
        3.2.2.RELEAS         


        
相关标签:
17条回答
  • 2020-12-13 13:05

    I imported a project as 'Existing Maven Project' and was getting this issue.

    Resolution: Changed Java Build Path of JRE System Library to Workspace defailt JRE [jdk 1.8]

    Steps:

    Right click on project -> build path -> configure build path -> Libraries Tab -> double click JRE System Library -> change to Workspace defailt JRE [jdk 1.8]

    0 讨论(0)
  • 2020-12-13 13:06

    In my case I had to delete the jars inside .m2/repository and then did a Maven->Update Maven Project

    Looks like the jars were corrupt and deleting and downloading the fresh jar fixed the issue.

    0 讨论(0)
  • 2020-12-13 13:07

    This answer from here helped me:

    You should take a look at the build path of your project to check whether the referenced libraries are still there. So right-click on your project, then "Properties -> Java Build Path -> Libraries" and check whether you still have the spring library JARs in the place that is mentioned there. If not, just re-add them to your classpath within this dialog.

    http://forum.spring.io/forum/spring-projects/springsource-tool-suite/98653-springframework-cannot-be-resolved-error

    0 讨论(0)
  • 2020-12-13 13:08

    In my case I used the below pom.xml file here

    and it worked for me.

    0 讨论(0)
  • 2020-12-13 13:09

    Add the following JPA dependency.

      <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
            </dependency>
    
    0 讨论(0)
  • 2020-12-13 13:10

    In my case, this issue was resolved by updating maven's dependencies:

    0 讨论(0)
提交回复
热议问题