当前位置:   article > 正文

java的lambda表达式,Java语言级别不支持lambda表达式“

java: -source 1.5 中不支持 lambda 表达式

I was testing out some new features of Java 8 and copied the example into my IDE (Eclipse originally, then IntelliJ) as shown here:

http://docs.oracle.com/javase/tutorial/java/javaOO/examples/RosterTest.java

Eclipse offered no support whatsoever for lambda expressions, and IntelliJ kept reporting an error "Lambda expressions not supported at this language level". I would like to know if this is a problem with my install, the code, or support.

解决方案

In IntelliJ IDEA:

In File Menu → Project Structure → Project, change Project Language Level to 8.0 - Lambdas, type annotations etc.

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号