SOLVED: Gradle fails to configure build on OSX with Unsupported major.minor version 52.0

This is the output of gradlew --version; it also reports that jav 1.8. is used:

./gradlew --version

------------------------------------------------------------
Gradle 2.14
------------------------------------------------------------

Build time:   2016-06-14 07:16:37 UTC
Revision:     cba5fea19f1e0c6a00cc904828a6ec4e11739abc

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0-ea (Oracle Corporation 24.0-b20)
OS:           Mac OS X 10.11.5 x86_64