I'm facing a build error when I try to run a Maven build. I created a simple Java project which includes lambda functions, due to this I'm getting
[ERROR] (...) lambda expressions are not supported in -source 1.5
[ERROR] (use -source 8 or higher to enable lambda expressions)
My Java version is 1.8.0_172, my Maven version is 3.6.0.
Add to your pom.xml
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
use maven compiler 1.8 or greater to enable lambda expressions in your code. Add the compiler as properties in your pom.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With