I don’t know if you guys have encountered such a problem: When you pull a new project from the Internet and import it into IDEA, you find that there is not only the jar package that the project depends on, but also the JDK in the External Libraries directory? Open each java class in the src directory, the content can be displayed, but the color is very monotonous, and special places are not highlighted with special colors?
In this article, I will share with you my experience of stepping on pits and pit avoidance skills.
Solution 1: Choose the correct import directory
When we import the project, we must select the parent directory of the src directory to import, instead of selecting the src directory, grandfather directory, etc. . .
In the above example, the parent directory of the src directory is backserver, but when I imported it, I chose celebritiesqathering-master.
This imports not only the back-end project backserver, but also the front-end project, related documents, etc. IDEA will be difficult to identify, resulting in the inability to automatically import dependent jar packages.
Solution 2: Change settings + re-import modules + restart IDEA
Generally speaking, if the correct directory is selected, IDEA will automatically import the dependent jar package. If it is not successful, you need to configure the IDEA environment.
The configuration steps refer to https://blog.csdn.net/qq_29410905/article/details/80084510
1.settings->Build,Execution,Deployment->Maven->勾选Always update snapshots
2. Re-import the module
Project Structure-> Modules
Delete the original Module first
Import the original project