Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lambda expressions are not supported in -source 1.7 [duplicate]

I have maven project opened in Eclipse. But when I do clean and install, I get above error.

I changed my build path to use SE 1.8 and my compiler is also configured to use 1.8. You can see that in following screen shots.

enter image description here

enter image description here

I am seeing little red crosses in project explorer too. You can see that in following picture.

enter image description here

I am not sure why maven is using SE 1.7 when I have configured it to use 1.8 in Eclipse.

like image 456
Darshan Puranik Avatar asked Jan 24 '17 08:01

Darshan Puranik


1 Answers

You need to configure maven to use 1.8 compatibility when compiling:

    <build>
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <encoding>utf8</encoding>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
     </plugins>
   </build>
like image 110
marthursson Avatar answered Oct 19 '22 20:10

marthursson