user4127671
user4127671

Reputation:

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. Before you downvote stating this is Repeated question I have already checked this and this and this . I have checked everywhere on the internet but to No avail. And If Downvotiong, give explicit/very very solid reason for the same.

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. Here is my 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 language level > 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)

Upvotes: 2

Views: 945

Answers (1)

user4127671
user4127671

Reputation:

Ok So after brainstorming (Lets call it in the most R-rated strong language usage brainstorming) I found that the BuildConfig file has got

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. There are other problems but they are for some other day.

Upvotes: 1

Related Questions