Wednesday, December 2, 2015

[Java][NetBeans][Resolved] lambda expression not expected here

IDE version: NetBeans IDE  8.0.2

Error message

lambda expression not expected here

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




Solution

I used an old version JDK  (1.7) for the project and it does not support the underlined sytnax/expression in red. Things to do is change the JDK version to compile your project.

===========================
Step 1)
Right click your project name with icon in projects explorer.



Step 2)
and select "properties".

Step 3)
Select Categories ->Sources -> Source/Binary Format, for my case using the JDK7 would causes the problem, so change it to the latest JDK (JDK8) and click OK button


Step4
Wait a moment and you may found the error message disappear.

6 comments :

  1. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 
    rpa training in bangalore
    best rpa training in bangalore
    rpa training in pune | rpa course in bangalore
    rpa training in chennai

    ReplyDelete
  2. Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up!
    Data Science Training in Indira nagar
    Data Science training in marathahalli
    Data Science Interview questions and answers
    Data Science training in btm layout
    Data Science Training in BTM Layout
    Data science training in bangalore

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete