在Netbeans中使用try-with-resources

Che*_*How 5 java netbeans try-with-resources

我在Java servlet类中有一个try-catch语句.Netbeans显示错误:

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

我怎样才能摆脱这个错误?

XP1*_*XP1 5

您似乎从 NetBeans 论坛找到了我的帖子,我在其中发布了解决方案:

我收到错误,要离开。

右键单击项目 > 属性 > 源 > 源/二进制格式:JDK 7 > 确定。

来源: