Errors in the compilation of the new project are as follows:
The reason lies in the error caused by the inconsistency between the target bytecode version of the module and the actual compiler version.
Regardless of the three seven twenty one, change all jdk versions to the same, first press the shortcut key ctrl+shift+alt+s
:
After the project sdk is changed, also change the sdk of the module:
Finally, press the shortcut key ctrl+shift+s
to modify the Java Compiler configuration, unify the byte code version
and the sdk version
, don't care who is high and which is low, it will be no problem if it is the same:
Of course, if you are a maven project, you may also need to change the jdk version configuration of the pom.xml
file:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>