I use Android Studio and recently got the error:
Error:Execution failed for task \':app:compileDebugJavaWithJavac\'. compileSdkVersion \'android-24\' re
In Android Studio open: File > Project Structure > SDK Location > Select jdk1.8.0_101.jdk > Home