关于idea中使用lamb表达式报错:ambda expressions are not supported at this language level

我使用的是jdk1.8,使用lamb表达式的时候,报错

ambda expressions are not supported at this language level,

后来,设置了

接着重启了项目,在使用的过程中依然报错,后来查阅资料,说虽然设置了,但是idea默认还是1.5,关键的是需要在pom.xml文件中添加:

<properties>    <maven.compiler.source>1.8</maven.compiler.source>    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

添加以上两段,重启,OK

原文地址:https://www.cnblogs.com/ylht/p/11032437.html

时间: 2024-08-01 19:06:45

关于idea中使用lamb表达式报错:ambda expressions are not supported at this language level的相关文章

log4j的1.2.15版本,在pom.xml中的顶层project报错错误: Failure to transfer javax.jms:jms:jar:1.1 from https://maven-repository.dev.java.net/nonav/repository......

在动态网站工程中,添加了Pom依赖,当添加log4j的1.2.15版本依赖时,在pom.xml中的顶层project报错错误: Failure to transfer javax.jms:jms:jar:1.1 from https://maven-repository.dev.java.net/nonav/repository......,如下图 这是因为 https://maven-repository.dev.java.net/nonav/repository 这个域名已经无法解析了. 而

Android工程中加入图片,报错cannot be resolved or is not a field

SDK和ADT为22.6.2版本 工程为4.4.2 今天在写Android代码的时候,往工程中加入了几张图片,然后在代码中使用R.drawable调用时,一直报错 cannot be resolved or is not a field 然后我查看了gen目录下的R.java文件,发现里面已经有我加入的图片资源ID了,觉得很奇怪,一般是无法生成R.java文件的时候才会出现这种现象啊 在网上查了资料也未见有可以解决我这个问题的方法,然后我就把我的代码从头到尾重新看了一遍,开始也没有发现什么异常,

在用TabbarController中出现navigationController 嵌套报错

如果出现: nested push animation can result in corrupted navigation bar Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. 一般这种情况是在自定义的tabbarController 的ViewWillAppera中没有调用superWillAppera, 调用父类方法就

jsp页面中onsubmit=&quot;return checklogin();&quot;报错解决办法

选择Window->Preferences->MyEclipse->Validation 去掉方框里的对号,然后Apply 然后点击Yes->然后再点击ok->Yes,就好了,如果你打开了那个出现错误jsp页面的话,请关掉重现打开就ok啦 jsp页面中onsubmit="return checklogin();"报错解决办法,布布扣,bubuko.com

android URL中文和空格会报错解决方案

url = URLEncoder.encode(urlStr,"utf-8").replaceAll("\\+", "%20"); //encode会将空格替换为+号,所有要讲+号替换为空格的转义%20 url = url.replaceAll("%3A", ":").replaceAll("%2F", "/"); //encode会把url里的/和:这2个符号变成%

MyEclipse中jsp的注释报错解决

jsp页面中注释报错: 出错现场:在eclipse中没有报错,在MyEclipse中报错. <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> Myeclipse的js中不会识别这样的标识 需要改成: //  To use express install, set to playerProductInstall.swf, otherwise the empty

Android中TextView setText int 报错

在对中TextView setText 覆值int 时报错,网上查下原因是setText整型表明是设值R.id.xxx,当然找不到. 解决方法是将int转化为string,用String.valueOf(xxx) Android中TextView setText int 报错,布布扣,bubuko.com

关于RN中导入第三方图片库报错:Unrecognized font family &#39;FontAwesome&#39;

废话不多说,上解决方案: 1.找到Fonts文件,把它拖到Images.xcassets目录下,下面是截图- 2.设置plist文件,别犹豫,手动修改 3clean-build-run,你会发现问题消失了,因为修改了xcode里面的东西,所以一定要重启项目. 关于RN中导入第三方图片库报错:Unrecognized font family 'FontAwesome'

eclipse中的js文件报错的解决办法

在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. Eclipse代码   右键点击项目->properties->Validation->Errors/Warming 将Enable Javascript Sematic validation前面的钩子去掉 2.打开.project 文件下面代码去掉 Eclipse代码   <buildCommand> <name>org.eclipse