Maven Compile failed for lambda or method references

Hi, all:

The Maven plugin in pom.xml can fail your compile with messages like this:

lambda expressions are not supported in -source 1.5 and/or method references are not supported in -source 1.5.

This happens even if your environment is purely JDK 8 (Eclipse, Maven etc).

It turns out the default plugin source is 1.5! So it would fail the compile right off the bat.

An easy fix is to add the source and target to be JDK 8 like this:


It works greatly with this source/target explicitly set.



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s