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

  今天用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

你可能感兴趣的:(Android,Studio/Eclipse)