相关疑难解决方法(0)

IDEA:javac:源版本1.7需要目标版本1.7

运行JUnit测试时,使用IntelliJ IDEA,我得到了

在此输入图像描述

我怎么能纠正这个?

  • 使用SDK 1.7
  • 模块语言级别为1.7

Maven构建工作正常.(这就是我在IDEA配置问题中相信这一点的原因)

java intellij-idea

458
推荐指数
8
解决办法
21万
查看次数

Maven编译错误:(使用-source 7或更高版本启用菱形运算符)

我在IntelliJ,JDK1.8,maven 3.2.5中使用maven.编译错误:使用-source 7或更高版本启用钻石歌剧.详情如下:

  [ERROR] COMPILATION ERROR : 
  [INFO] -------------------------------------------------------------
  [ERROR] TrainingConstructor.java:[31,55] diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)
  [ERROR] DTM.java:[79,21] try-with-resources is not supported in -source 1.5  (use -source 7 or higher to enable try-with-resources)
  [ERROR] ticons.java:[53,44] diamond operator is not supported in -source 1.5  (use -source 7 or higher to enable diamond operator)
Run Code Online (Sandbox Code Playgroud)

有什么建议?是否有其他配置来设置此-source级别?好像它不使用java 1.8.

java intellij-idea maven-3 maven

45
推荐指数
3
解决办法
5万
查看次数

标签 统计

intellij-idea ×2

java ×2

maven ×1

maven-3 ×1