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.