小编Yan*_*kee的帖子

使用Try-Catch with Resources时,IntelliJ IDE会出错

我试图使用JDK 7的"try-catch with resources"声明; IntelliJ强调我的资源线,说

此语言级别不支持尝试使用资源.

当我尝试编译时,我得到:

java:在-source 1.6中不支持try-with-resources(使用-source 7或更高版本来启用try-with-resources)

我检查了我的当前项目是否启用了try-with-resources,我的项目是使用JDK 7(Library:C:\ Program Files\Java\jdk1.7.0_11).有任何想法吗?我无法弄清楚要改变什么选项(如果这甚至是问题).

java try-catch intellij-idea try-catch-finally try-with-resources

49
推荐指数
4
解决办法
3万
查看次数