Java – compilation errors using NetBeans 8 but lower than lambda expressions

I'm using NetBeans 8 When my code contains a lambda expression and I try to compile, I receive 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)

Solution

Change the compiler version of your source code to the project properties of JDK 8, and then first check whether one is installed

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>