Android Studio 需要 JDK 7 for Android-L mac [英] Android Studio needs JDK 7 for Android-L mac

查看:35
本文介绍了Android Studio 需要 JDK 7 for Android-L mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看我的应用在材料设计中的外观,我想使用新的卡片库.我的问题是,它在我的 gradle 文件中给了我这个错误,我需要解决这个问题.

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

我下载了 jdk-7u60-macosx-x64.dmg 并安装了它.java -version 在终端中显示 1.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)

好吧

ls -l `which java`

正在给我:

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

.../current/... 没有 .../home.我在这里找到了 .../home:

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

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

并将路径设置为Android Studio中JDK位置"下的SDK位置"首选项.但是还是不行——好像还是找不到JDK 7.

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.

我使用的是 Mac OSX 10.9.3 和 Android Studio(测试版)0.8.1.

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

推荐答案

设置目录为:/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home在 JDK 设置中解决了我的问题.我在启动时遇到了同样的问题.希望这会有所帮助!

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!

这篇关于Android Studio 需要 JDK 7 for Android-L mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆