One - One Code All

Blog Content

idea,lambda表达式编译不支持 lambda expression are not supported at this lanague level

Java   2016-07-09 22:26:00

idea,lambda表达式编译不支持 lambda expression are not supported at this lanague level


在idea中使用到了“ -> ”符号,即jdk1.8才有的lambda表达式(数学上写作‘ λ ’),冒红线并提示lambda expression are not supported at this lanague level


1.点击idea左上角“File”菜单栏,选择“Project Structure"


2.进入对话框后,选择左侧“Modules",在右侧选择Language level,点击下拉框,选择”8-Lambda,type annotations etc.",因为他默认是“7 Diamonds, ARM,muti-catch etc."


3.选择完,点OK就好了



上一篇:slf4j-api和slf4j-simple的关系,启动报错Failed to load class org.slf4j.impl.StaticLoggerBinder
下一篇:关于DefaultHttpClient过时的问题

The minute you think of giving up, think of the reason why you held on so long.