I had Java 1.7.0_21 installed and I installed 1.7.0_45 today after uninstalling the previous version. Now Android Studio has stopped compiling projects and says that it cant
Go to File> Project Structure (or press Ctrl+Alt+Shift+S),
A popup will open now go to SDK Location Tab you will find JDK Location there refer this image to be more clear.