Intellij picking up JDK 1.6 instead of 1.8

时间:2016-04-29 20:19:40

标签: java intellij-idea

I download project from Repo today and try to run it for the first time and it wont Pick JDK 1.8 installed. Before you downvote stating this is Repeated question I have already checked thisthis以及this中。我已经在互联网上到处检查但无济于事。如果Downvotiong,给出明确的/非常非常坚实的理由。

以下是错误消息: -

error: diamond operator is not supported in -source 1.6
        Set<String> result = new HashSet<>();
                                         ^

我正在使用Mac和Intellij Ultimate。这是我的java --version

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

这是我的文件&gt;项目结构&gt;模块&gt;来源

8. Lambdas, type annotations etc.

档案&gt;项目结构&gt;项目&gt;项目SDK&gt; javaversion "1.8.0_25"

项目语言水平&gt; SDK Default(8 - Lambdas, type annotation etc.)

在我的/ bash_profile中有export JAVA_HOME=$(/usr/libexec/java_home -v 1.8.0_25)

1 个答案:

答案 0 :(得分:0)

好的,所以在头脑风暴之后(让我们用最R级的强语言使用头脑风暴来称呼它)我发现BuildConfig文件已经有了

grails.project.target.level = 1.6
grails.project.source.level = 1.6

将其更改为1.7以及未识别&lt;&gt;的问题离开了。还有其他问题,但它们是其他日子。

相关问题