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

阅读 76

2022-01-28


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

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


精彩评论(0)

0 0 举报