Solve Intellij idea Error: java: invalid source release: 16

created at 09-27-2021 views: 1644

error

Project compilation error:

 Error: java: invalid source release: 16

solution

The reason lies in the error caused by the inconsistency between the target bytecode version of the module and the actual compiler version.

To change all jdk versions to the same, first press the shortcut key Ctrl+Shift+Alt+S:

PROJECT SDK

After the project sdk is changed, the sdk of the module is also changed to the same:

sdk of the module

Finally, if the error is the same and the jdk version is the same, but the problem still cannot be solved, please read  Solve Intellij idea Error: java: invalid source release: 1.8 and modify the pom.xml file as needed.

created at:09-27-2021
edited at: 06-03-2022: