Errors in Jdk5 in intellij, although pom.xml explicitly sets the source to 7

I opened the maven project in Intellij (14.1.4 Ultimate) and the JDK is not recognized. When I try to start one of the programs, the following error occurs: and in any case, the file has a bunch of “red” ones in it when viewed in the IDE:

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

This is strange because the usual settings are used to use java7:

In pom.xml:

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

In the project, the JDK level is set to 7:

enter image description here

Similarly in the module:

enter image description here

But when you try to compile (even after re-importing maven projects) all kinds of problems arise:

enter image description here

Note. This project creates / runs on the command line using maven.

Also note: I already tried to blow away the Intellij project and rebuild from scratch. No change in behavior.

() @Peter Lawrey. , jdk 1,5. 1.7 .

enter image description here

+4
1

IntelliJ , . :

File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler

1.7 1.5.

pom, , 1.5, - 1.8. .. .

+4

Source: https://habr.com/ru/post/1619942/


All Articles