Usage of API documented as @since 1.7+ 的报错:
1. IDEA :
例如:forEach(s -> System.out.println(s)); 报此错误
2. 解决办法 :
要看的几个地方:
1). File -> Project Structure -> Project -> Project Language Level 选择“8 Lamdas Type Annotations etc”;
2). 如果没有改选项请先安装和配置JDK1.8;
3). File -> Project Structure -> Project -> Modules 选择“8 - Lamdas ,Type Annotations etc”;
4). File -> setting -> Build,Execution,Deployment -> Compiler -> Java Compiler
选择Project bytecode version(改为 1.8)、Target bytecode version(1.8)