Error:java: invalid source release: 8 in Intellij. What does it mean?

前端 未结 16 1035
旧时难觅i
旧时难觅i 2020-11-27 08:55

Im trying to compile some code in I\'m using Intellij Ultimate 13.1.4, but I get the following error and I have no idea what it means:

Information:Using java         


        
16条回答
  •  青春惊慌失措
    2020-11-27 09:46

    I had the same issue when "downgrading" a project from Java 8 to Java 6. The reason was that it was not changed at all places in IntelliJ.

    In IntelliJ 13.1.4 I had to change Java and SDK version on the following places not to get this error:

    • File -> Project Structure -> Project Settings
    • File -> Project Structure -> Module Settings -> Tab: Sources: Language Level
    • File -> Project Structure -> Module Settings -> Tab: Dependencies: Module SDK
    • File -> Settings -> Compiler -> Java Compiler -> Target bytecode version

    The last bullet was the one that was not updated in my case. Once I changed this, the error disappeared.

提交回复
热议问题