Android Studio needs JDK 7 for Android-L mac
Setting the directory to:
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home
in JDK settings solved my issue. I had the same problem getting started up. Hope this helps!
@megapoff answer is correct . But I face little difficulty to fix it . So here is the detail solution step-by-step
For Mac
- Download the DMG file of JDK-7 from here
- Click on DMG and follow the instructions . It will install and configure JDK-7 on mac .
- Now in your android studio go to File->Project Structure -> SDK Location .
In JDK location click on browse and go to
/->Library->Java->JavaVirtualMachines->jdk1.7.0_60.jdk->Contents->Home
Note :- Its Not
/System/Library
it's/Library
click Apply and OK .... Bingo ..... Build the project again .....
The other answers are very correct but I want to be more concise and clear. To prevent others from visiting this page multiple times unnecessarily.
Important* Old Path is /System/Library/Java... and New Path is /Library/Java... (Not under the System directory)
Replace old path: /System/Library/Java/JavaVirtualMachines/jdk1.6.0_0.jdk/Contents/Home
Set your new path: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home