Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ won't accept Java8 and diamonds at the end of List/Map

I'm using the latest JDK and everywhere from project creation to now everything is set to Java8 or SDK 8.

Still, intelliJ gives me this issue:

enter image description here

The red lamp tells me to change to Java7.

This is my project settings: enter image description here

and this is the Modules section: enter image description here

As you can see; I specifically changed it from the SDK default to java 8 when I got the error, but no result.

The compiler settings look like this: enter image description here

I'm on a macbook and the intelliJ is the community version. Does anyone know why this is happening and how I fix it?

like image 629
Gemtastic Avatar asked May 13 '15 13:05

Gemtastic


1 Answers

Try to run the project, if this is your error message: enter image description here

Then I suggest you have a little look into your pom-file.

This project was built using the intelliJ maven project setting, and it was missing this lovely line of code:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

IntelliJ doesn't (at least in my case) generate the version in the pom (despite that I picked all the settings for it).

like image 184
Gemtastic Avatar answered Oct 15 '22 05:10

Gemtastic