Java try-with-resources 中的细节_java构建 错误: -source 1.6 中不支持 try-with-resources-CSDN博客

网站介绍:文章浏览阅读532次。在 Java 7 之前,程序中如果有需要关闭的资源,例如 java.io.InputStream、java.sql.Connection 等,通常会在 finally 中关闭,例如:InputStream inputStream = null;try { inputStream = new FileInputStream("/my/file"); // ...} catch (Exception e) { e.printStackTrace();} finally { _java构建 错误: -source 1.6 中不支持 try-with-resources