Check Installed JDKs, Ensure the desired JDK version is installed.
Open Android Studio Preferences
Open Android Studio. Go to Preferences -> Navigate to JDK Settings
In the Preferences window, go to: Build, Execution, Deployment > Build Tools > Gradle. Change the JDK Path
Under "Gradle JDK," click the dropdown and select your desired JDK version.