is not allowed for source level below 1.7 的解决办法

今天用Ecliipse导入了一个工程,发现了一个错误:

catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)

这写法没见过。

提示is not allowed for source level below 1.7。


解决办法:

右键项目--属性--Java Compiler--勾选Enable project specific settings

Compiler compliance level--选择1.7

勾选Use default compilance settings

OK

猜你喜欢

转载自blog.csdn.net/quantum7/article/details/80248378