If you are facing above error Go to Right Click on project->Module Settings-> enter image description here
and then come back and go to setting set your JDK which version you have given in module settings