I have the problem mentioned in the title. You could say that this thread duplicates another one: How do I turn off error validation for annotations in IntelliJ IDEA?
Bu
If you are using maven, add maven compiler plugin to the project's pom.xml file.
org.apache.maven.plugins maven-compiler-plugin 3.1 1.7 1.7
This solved the issue for me.