Eclipse created maven project structure is incomplete

There are many ways to solve this problem. As far as I know, there are at least three ways, so I won't go into details here.

Adhering to the principle of being able to Ctrl+C/V and never typing code, here is the simplest solution.

Problem description: First, describe the problem. The picture below is a maven project made by my eclips. Obviously, there is a problem with the structure.


Reason: This situation is caused by the conflict between the default jdk version of the project and the jdk version of the development tool.

Solution: Since it is inconsistent, change it to be consistent.

Right-click the project, Build Path > Configure Buid Path > Libraries


Select the jdk version you want to use.


Finish > Apply > OK  

After the modification, the project structure is normal, and the attached picture is as follows.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326431463&siteId=291194637