摇篮未设置JAVAHOME中提及gradle.bat [英] Gradle is not setting the javahome in mention in gradle.bat
问题描述
在运行我的项目,我得到这个错误:
When running my Project, I get this error:
Error:Invalid Gradle JDK configuration found. <a href='#open_external_system_settings'>Open Gradle Settings</a>
Platform SDK does not point to valid JDK (C:/Program Files/Java/jdk1.7.0_71)
要解决这个问题我想设置我的gradle.build JAVAHOME为
To fix this I tried setting my javahome in gradle.build as
:findJavaFromJavaHome set JAVA_HOME=C:\Data\jdk1.7.0_55 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
我仍然得到同样的错误。谁能帮PLS。
Still I get the same error. Can someone help pls.
推荐答案
我最近有同样的问题。
I had this same problem recently.
首先确保你的Android工作室更新。
First make sure your Android Studio is updated.
然后,在错误中心,它引导你,你有本地摇篮和推荐摇篮包装之间作一选择弹出窗口(很抱歉,如果名称不完全匹配,因为这是前一段时间)
Then, in the error center, it directs you to a pop-up window which you have to choose between "Local Gradle" and "Recommended Gradle wrapper" (Sorry if names doesn't exactly match since it was while ago)
对于我来说,被设置在本地摇篮,我改成了推荐的一个,等了那么重建该项目。有人做过之后,错误走了第二名,我看到了同样的错误,当我再次打开这个窗口,我看到它被设置在本地摇篮了,虽然我选择了建议之一。
For me it was set on Local Gradle and I changed it to the "recommended" one and waited so it rebuild the project. After it was done, the errors went away for second and I saw the same error and when I opened that window again, I saw it is set on "Local Gradle" again, although I chose the recommended one.
所以我也选择了再次推荐这一次,它是固定的,住固定的,我没有问题了!
So I did chose recommended again and this time it was fixed and stayed fixed and I had no problem anymore!
希望你的作品
更新 如果以上方法无效,应该是因为ü最近更新你的Java。所以看<一href="http://stackoverflow.com/questions/26689513/errorcompilesdkversion-android-21-requires-compiling-with-jdk-7">this问题并改变你的Java SDK的路径
UPDATE If the above way doesn't work, it should be because u have recently updated your Java. so see this question and change the path of your Java SDK
这篇关于摇篮未设置JAVAHOME中提及gradle.bat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!