Solve the error when using IDEA to start the SpringBoot project: java: Warning: Source release 17 requires target release 17 or java: Invalid target release: 17

Problem Description

I created a new SpringBoot project today, and when starting it reported the following error:

Insert image description here

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

Insert image description here

The following modifications are mainly made here

Insert image description here

Insert image description here

Insert image description here

After modification, click apply, ok and then start again

Found an error

Insert image description here

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.

Insert image description here

After setting, save and exit, and restart to solve the problem.

ps: Finally, mark the corresponding JDK version in the pom file:

Insert image description here

Summarize

When developing, be sure to pay attention to issues between the versions used! ! !

Guess you like

Origin blog.csdn.net/weixin_46713508/article/details/134193637