Using NetBeans 8 but getting below compilation error for Lambda expression

前端 未结 4 942
情歌与酒
情歌与酒 2020-12-20 12:52

I am using NetBeans 8. When my code contains a Lambda expression and I try to compile, I get the following error message:

lambda expression not expected here

lam         


        
相关标签:
4条回答
  • 2020-12-20 13:13

    Please click right from you project -> Properties -> Choose Sources -> (you will see Source/Binary Format) change it to 1.8 -> Click OK.

    Or you can see in this link http://tinadev.blogspot.com/2015/08/lambda-expression-not-expected-here.html

    Thanks

    0 讨论(0)
  • 2020-12-20 13:19

    In the project properties dialog, select Sources in the left panel and then on the bottom right look for "Source/Binary Format" Change that to JDK 8.

    0 讨论(0)
  • 2020-12-20 13:21

    Change compiler version of your source code into your project properties to jdk 8 and firstly check whether you have installed one.

    0 讨论(0)
  • 2020-12-20 13:30

    Download JDK 1.8 to resolve this issue. change the JAVA_HOME environment variables path to jdk_1.8. Right Click on the project folder which has the above mentioned compilation error and select properties. In Sources tab change the source/binary format to JDK 8. In libraries change Java Platform to JDK 1.8.

    0 讨论(0)
提交回复
热议问题