I work in Intellij IDEA.
Set levels:
ctrl+shift+alt (Project Structure) -> Sources -> Language level : 7 ctrl+shift+alt (Project Structure) -> Project -> Project language level : 7 ctrl+alt (Setting) -> Compiler -> Java Compiler : 1.7 Sources code:
public void setLogProperty(String pathLogProperties) { try (FileInputStream fileInputStream = new FileInputStream(pathLogProperties);) { ... } catch (IOException e) { e.printStackTrace(); } } How to solve a problem?