0

After changing the java version to 1.8 in pom.xml I get still the following error message at running mvn install:

lambda expressions are not supported in -source 1.6 
(use -source 8 or higher to enable lambda expressions)

My maven-compiler-plugin.

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                          <compilerArguments>
                                <encoding>${project.build.sourceEncoding}</encoding>
                          </compilerArguments>
                    </configuration>
                </plugin>
Bajdu
  • 11
  • 1
  • 2
  • possible duplicate of [How do you specify the Java compiler version in a pom.xml file?](http://stackoverflow.com/questions/16723533/how-do-you-specify-the-java-compiler-version-in-a-pom-xml-file) – Gemtastic Jul 07 '15 at 13:37

2 Answers2

3

Try adding this to your pom.xml too:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>
sinclair
  • 2,812
  • 4
  • 24
  • 53
0

I fixed the error by adding the following under the <configuration> element:

<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
Chad Nouis
  • 6,861
  • 1
  • 27
  • 28
Bajdu
  • 11
  • 1
  • 2