Error:java: javacTask: source release 8 requires target release 1.8
编译无问题,运行时报错:
环境:
JDK Version: 1.8.0_171
IDE: IntelliJ Idea 2018
IntelliJ SDK Setting
解决:
1、将Target Bytecode Version设为1.8 。
2、如果项目使用maven管理的,检查修改pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
然后maven重新reimport the project即可