The springboot project appears "java: Error: Invalid source release version: 17" Problem solution
The following is the error page
In the case where I personally encountered this problem, the reason for this error was that the version of springboot was inconsistent with the version of java
After the spring3 update, idea will select spring3 by default when creating a springboot project , even if you choose the version of java8
idea defaults to spring3
When you create spring3 with java8 After completing the project, "java: Error: Invalid source release version: 17" will definitely appear. If you search this problem on Baidu, it will only let you change the jdk version of your project as follows
However, changing it has no effect. When you start the springboot project, it will change back to the java17 corresponding to spring3
To fix this bug without re-creating the project, we only need to open the pom file and modify the springboot version it specifies. Remember that the latest stable spring2 version is the version at the bottom of the drop-down box when you create the spring project, which is 2.7.11 , and then the pom also specifies the java version, we also need to change it to 8
Modified pom file
After that, our spring project bug will be fixed
The above is the detailed content of How to solve 'java error invalid source release 17 problem' in SpringBoot project. For more information, please follow other related articles on the PHP Chinese website!