使用 NetBeans 8 但遇到 Lambda 表达式的编译错误 [英] Using NetBeans 8 but getting below compilation error for Lambda expression
本文介绍了使用 NetBeans 8 但遇到 Lambda 表达式的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是 NetBeans 8.当我的代码包含 Lambda 表达式并尝试编译时,我收到以下错误消息:
<前>此处不需要 lambda 表达式-source 1.5 不支持 lambda 表达式(使用 -source 8 或更高版本来启用 lambda 表达式)----(Alt-Enter 显示提示) 解决方案
将你的源代码的编译器版本更改为你的项目属性为 jdk 8 并首先检查你是否安装了一个.
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)
解决方案
Change compiler version of your source code into your project properties to jdk 8 and firstly check whether you have installed one.
这篇关于使用 NetBeans 8 但遇到 Lambda 表达式的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文