apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 23
    }
    dataBinding {
        enabled = true
    }
}
This is my build.gradle.It's compile success in Android Studio.
But when I run on  ./gradlew build terminal.
It was build error.
The error:
What went wrong:
A problem occurred evaluating project ':app'.
java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
./gradlew -v
------------------------------------------------------------
Gradle 2.14.1
------------------------------------------------------------
Build time:   2016-07-18 06:38:37 UTC
Revision:     d9e2113d9fb05a5caabba61798bdb8dfdca83719
Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.7.0_71 (Oracle Corporation 24.71-b01)
OS:           Mac OS X 10.11.4 x86_64
 
    