Go to Setting -> Build, Execution, Deployment -> Build Tools -> Gradle. Try to set Gradle JDK version 17