idea编译报错 javacTask:源发行版1.8 需要目标发行版1.8
错误描述![在这里插入图片描述](https://img-blog.csdnimg.cn/3f2afc634ec94d7d9f2a3f2b70ddb38e.png)
错误原因
指定java版本小于8
解决方案
1.settings 设定language level
settings -> Build,Execution, Deployment -> Compiler -> Java Compiler
设置相应Module的 bytecode version即可
2.project structure设定language level
project structure -> project settings -> modules
3.pom文件设定language level
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8