Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

lambda expressions are not supported in -source 1.5
  (use -source 8 or higher to enable lambda expressions)
----
(Alt-Enter shows hints)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
497 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

For NetBeans IDE 8.2, JDK 8


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...