roie123400010
roie123400010

Reputation: 43

Maven cannot compile lambda expression

I am new to maven and I am trying to compile a lambda expression. When I run mvn install I get this error:

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

I am using SDK version 1.8 as can be seen in this image:

And the code that causes the compile error is this (the error accures on line 11):

Thanks in advance!

Upvotes: 0

Views: 133

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35883

As stated in the comments, you need to set the source and target levels in you POM.

These can be smaller than the actual JDK you use.

Upvotes: 1

Related Questions