If you are an IntelliJ IDEA user and you are using Maven in your project, chances are you may some day run into this incredibly cryptic and confusing message:
Error: javac: source release 1.6 requires target release 1.6
Googling it digs up a few approaches to solving the problem as well as some IntelliJ IDEA bug reports where people describe needing to re-create their projects to get rid of it.
Fortunately for me, the fix was exactly what was outlined by Daniel Höpfl here. Daniel pointed out that in his install of IntelliJ IDEA, under the File > Settings > Compiler > Java Compiler preference screen, for some reason “-target 1.4” had been set as an additional compiler parameter. Turns out, that is exactly what happened to me too:
All I had to do was remove that bogus setting and everything worked again.
The odd thing is that I’ve never messed with these settings before, the one thing I did do was configure the “maven-compiler-plugin” Maven plugin as well as the “maven-dependency-plugin” for my project — it is possible there is a synchronization bug in IntelliJ that causes that value to populate when trying to parse those settings from your project’s pom.xml, but that is just a guess.