Problem Description
I created a new SpringBoot project today, and when starting it reported the following error:
java: warning: source distribution 17 requires target distribution 17
analyse problem
In fact, the error is already obvious. Since I only have JDK8 environment locally, but the JDK of the project and compiler is 17, I just need to modify the JDK version at this time.
Solve the problem
The following main changes are made:
1 Project Structure
The following modifications are mainly made here
After modification, click apply, ok and then start again
Found an error
This is because the JDK version edited by the project has not been set yet. Find this option in the setting and modify these two places to the corresponding JDK version.
After setting, save and exit, and restart to solve the problem.
ps: Finally, mark the corresponding JDK version in the pom file:
Summarize
When developing, be sure to pay attention to issues between the versions used! ! !