如何将sourceCompatability设置为javaVersion.VERSION_1_8

Moe*_*saz 4 java android java-8 android-studio

我安装了jdk1.8.0_112并在build.gradle中编写了以下代码

 compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.
Run Code Online (Sandbox Code Playgroud)

谁能帮我?