Android Studio needs JDK 7 for Android-L mac

Rasalas picture Rasalas · Jun 29, 2014 · Viewed 86.3k times · Source

I was trying to look how my app looks in material design and I would like to use the new cards lib. My Problem is, that it's giving me this error within my gradle file and I need to fix that.

Error:compileSdkVersion android-L requires compiling with JDK 7

I downloaded jdk-7u60-macosx-x64.dmgand installed it. java -versionin Terminal is showing me that 1.7 is installed:

java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

well

ls -l `which java`

is giving me:

/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

.../current/... doesn't have a .../home. I found the .../home here:

/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

And set the path to the "SDK location" Preferences in Android Studio under "JDK location". But it's not working -- it seems that it still can't find JDK 7.

I'm using Mac OSX 10.9.3 and Android Studio (Beta) 0.8.1.

Answer

megapoff picture megapoff · Jun 29, 2014

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!