Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
219 views
in Technique[技术] by (71.8m points)

java - Android Studio needs JDK 7 for Android-L mac

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...