Go to Android Studio → Settings → Build → Build Tools → Gradle
Then, change the JDK version according to your project requirements.