Information:java: javacTask: 源发行版 8 需要目标发行版 1.8
原文链接:https://blog.csdn.net/idiot_qi/article/details/105149846
创建新maven项目跑main,出现这个编译异常
网上找了找,记录一下以备不时之需
需要将以下几个位置的JDK都要设置成1.8才行
-
Settings 搜索Java Compiler
(File | Settings | Build, Execution, Deployment | Compiler | Java Compiler)
需要修改 Project bytecode version 和 Target bytecode version -
Settings 搜索Maven,找到Runner
(File | Settings | Build, Execution, Deployment | Build Tools | Maven | Runner) -
Project Structure | Modules下
Sources | Language level
Dependencies