So this is quite simple to solve.
Goto http://www.oracle.com/technetwork/java/javase/downloads/index.html and download the latest jdk for your architecture x32 or x64.
Install as usual and then goto Control Panel -> “Advanced System Settings”
Click on the “Enviroment Variables” and under “System Variables” click “New..”
Then create a new entry with Variable Name: “JAVA_HOME” and Variable Value: “C:\Program Files\Java\jdk1.7.0_21” (this differs according to the version and system).
Save and restart android studio installation and it should identify the correct pat.