If the solution given in the comments is not working. Then you can change the java path from the settings as well. Follow the steps to change the path