IntelliJ IDE gives error when using Try-Catch with Resources

前端 未结 5 643
栀梦
栀梦 2020-12-13 08:30

I am attempting to use JDK 7\'s \"try-catch with resources\" statement; IntelliJ highlights my resource line, saying

Try-with-resources are not supp

5条回答
  •  有刺的猬
    2020-12-13 09:14

    Click on the File menu, open Project Structure, then under "Settings" there should be "Project". Within that tab, there'll be an SDK Settings option which specifies the language version you want to use.

    See the JetBrains help page for more details ("Project language level").

提交回复
热议问题