On trying to run Android Studio 2.2 Preview 1, it gives the following error on gradle build:
Error:Please use JDK 8 or newer.
If
Use File -> Project Structure to set the SDK and JDK. I think you are modifying a generated file.
Also try adding this in your gradle file:
compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 }