简体   繁体   English

Intellij选择了JDK 1.6而不是1.8

[英]Intellij picking up JDK 1.6 instead of 1.8

I download project from Repo today and try to run it for the first time and it wont Pick JDK 1.8 installed. 我今天从Repo下载了项目,并尝试第一次运行它,它不会选择安装JDK 1.8。 Before you downvote stating this is Repeated question I have already checked this and this and this . 你downvote,说明这是重复的问题之前,我已经检查这个这个这个 I have checked everywhere on the internet but to No avail. 我已经检查了互联网上的所有地方,但无济于事。 And If Downvotiong, give explicit/very very solid reason for the same. 如果是Downvotiong,请给出明确/非常扎实的理由。

Here is the error message :- 这是错误消息:

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

Im using Mac and Intellij Ultimate. 我正在使用Mac和Intellij Ultimate。 Here is my java --version 这是我的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)

Here is my File > Project Structure > Modules >Sources 这是我的文件>项目结构>模块>源

8. Lambdas, type annotations etc.

File > Project Structure > Project >Project SDK > javaversion "1.8.0_25" 文件>项目结构>项目> Project SDK> javaversion "1.8.0_25"

Project language level > SDK Default(8 - Lambdas, type annotation etc.) 项目语言级别> SDK Default(8 - Lambdas, type annotation etc.)

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

Ok So after brainstorming (Lets call it in the most R-rated strong language usage brainstorming) I found that the BuildConfig file has got 好了,在进行了头脑风暴后(让我们以最R级的强语言用法头脑风暴来称呼它),我发现BuildConfig文件已经

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

Changed that to 1.7 and the problem of not identifying the <> is gone. 将其更改为1.7,无法识别<>的问题消失了。 There are other problems but they are for some other day. 还有其他问题,但是还有一段时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM