Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lambda expressions not working in netbeans jdk 1.8 project [duplicate]

Even though I changed my netbeans project's jdk to 1.8, it still gives the following error

lambda expressions not expected here

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

Any help is so much appreciated

like image 383
andy Avatar asked Apr 11 '26 23:04

andy


1 Answers

You have to set the project properties for the target version. Java 8 allows you to build for Java 7 execution, and that setting is still there from when you used Java 7. Right-click on the Project in the "Projects" window and select "Properties", then "Sources" in that dialog. On the right you will see "Source/Binary Format". Change that to "1.8", then click "OK".

like image 111
Lew Bloch Avatar answered Apr 14 '26 12:04

Lew Bloch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!