Despite specifying JDK 1.7 in all project settings (including in File -> Project Structure -> Project :: Project SDK), the following error is produced by
I managed to fix this by changing settings for new projects:
File -> New Projects Settings -> Settings for New Projects -> Java Compiler -> Set the version
File -> New Projects Settings -> Structure for New Projects -> Project -> Set Project SDK + set language level
Remove the projects
Import the projects