maven set the java compiler to 1.5

I created a new project with maven, I used maven-archetype-quickstart, but at the moment of compiling,  the next error show up : maven error: diamond operator is not supported in -source 1.5.  I check that the project settings and was set to java 1.5, I change the settings to 1.8 to all configuration I could find (java compiler settings, compiler.xml,  lenguaje level on projects and modules), that get rid of the problems, but when I click the button "Reimport all Maven projects" all of the configuration is set back to 1.5 again, I have check everywhere and cant find why its doing  this, I even try to set the default compiler to 1.8 on the pom.xml but that gives me more errors on the moment of compilation. Some one can tell me where can be  this error?

thanks in advance.

3 comments
Comment actions Permalink

Make sure to set the correct language level via maven-compiler-plugin:
http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html .

IntelliJ IDEA should repsect this setting on reimport.

0
Comment actions Permalink

Yes, Thank you for the answer , the problem was that the pom was not correctly configured.

0
Comment actions Permalink

Source/target for maven compiler plugin can be also configured using only properties like this:

<properties>

 
     <maven.compiler.source>1.7</maven.compiler.source>
     <maven.compiler.target>1.7</maven.compiler.target>
 
</properties>
0

Please sign in to leave a comment.