Error: (2, 35) java: package org.springframework.context does not exist or other packages do not exist

Error: (2, 35) java: package org.springframework.context does not exist

Problem description (prescribe the right medicine, if you are in this situation, please continue to read):

The IDE does not report red when writing code, and Ctrl+mouse click on the class or method can jump, but the operation is an error and the package cannot be found.

Solution 1: Click the box pointed by the arrow.
Insert picture description here
If it doesn’t work, click the arrow below, and the cache will be invalidated and rebuilt at the next startup.
Insert picture description here
Method 2: Comment out the custom central warehouse.
Insert picture description hereInsert picture description here
Create a new central warehouse and
Insert picture description here
finally do it in Maven. Refresh
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_46195957/article/details/113531206