I have a maven project in eclipse that uses some lambdas, which means I need java 8. I already installed the java version in maven to 1.8. However, I have to constantly open the project properties and set its compliance level to 1.8, because it is constantly reset to 1.6.
I am working on Eclipse EE Luna 4.4.0 and have tried different things, such as disabling for each project, or switching to a project and setting it to 1.8, but both things do not work in the long run.
Usually after re-matching project 1.8, the package view looks fine, but the editor still shows errors if I have an open file that uses lambdas. Then I have to click on the error sign in the editor and select the sentence "set the project compliance level to 1.8". Sometimes it works, sometimes not.
The problem starts specially after the eclipse starts, closes and opens the same project or when checks are performed. There are usually no errors in the package view when I do alt + f5 and update, but viewing the editor often still shows errors.
My eclipse maven plugin uses the same maven scripts that I use on the command line, and I never had problems on the command line.
It drives me crazy because it happens at least twice a day and has no direct way around it.
At the end of my pom and parent pom file, I have the following:
<project>
. . .
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Fabio source
share