IntelliJ IDEA 13设置为1.7仍使用Java 1.5

PNS:

尽管在所有项目设置(包括中的File -> Project Structure -> Project :: Project SDK中都指定了JDK 1.7 ,但是IntelliJ 13当尝试编译某些使用Diamond运算符的简单Java 7代码时,仍会产生以下错误

java: diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)

配置中是否还有其他-source 7应启用预期选项的地方

Djordje Ivanovic:

如果这没有帮助(我的情况),则可以在pom.xml中进行设置,如下所示:

<properties>
  <maven.compiler.source>1.7</maven.compiler.source>
  <maven.compiler.target>1.7</maven.compiler.target>
</properties>

正如这个帅哥在这里提到的那样:https : //stackoverflow.com/a/25888116/1643465

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章