Lambda expressions are not supported at language level '5 问题的解决

IDEA中新建maven项目时会自动将编译器和语言标准设置为1.5版本,由于LWJGL给的sample里使用了lambda,所以会报Lambda expressions are not supported at language level '5的错。

解决方案:在pom.xml中添加如下代码,

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
</build>

猜你喜欢

转载自www.cnblogs.com/eddywei/p/12388688.html