You say you are working with Java 7, but are you really sure?
Because, as far as I know, this error occurs exactly when you use a source / target level that is not supported by the JVM, you use gradle with. Therefore, if I were to assume that I would say that gradle seems like your JDK does not support Java 7 (therefore its JDK is 6 or lower)
Maybe double check that
a) gradle itself works with JDK 7. If you start gradle from Eclipse using the STS gradle tool, it will use the standard workspace JRE to start gradle. Make sure that it is at least JDK 7. (Go to βWindows Preferences β β Java β Installed JRE.β The checkmark JRE will work with gradle).
b) gradle may accidentally pick up another JDK to compile files if it finds a JAVA_HOME environment variable. So double check that it is not pointing to JDK 6 or lower.
Kris source share