报错:
Error:(19, 13) java: -source 1.5 中不支持 try-with-resources
(请使用 -source 7 或更高版本以启用 try-with-resources)
在网上查阅解决方法
- File - Project Structure -Project - Language Level 更改为8
无法解决。 - pom.xml 添加dependency
无法解决。
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
- File - Project Structure -Modules- Language Level 更改为8
解决。