使用NetBeans 8但低于Lambda表达式的编译错误 [英] Using NetBeans 8 but getting below compilation error for Lambda expression

查看:104
本文介绍了使用NetBeans 8但低于Lambda表达式的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NetBeans 8.当我的代码包含Lambda表达式并尝试编译时,我收到以下错误消息:

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)


推荐答案

将源代码的编译器版本更改为项目属性到jdk 8并首先检查你是否安装了一个。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆