从Android Studio调试时,Gradle无法使用JAVA_HOME [英] Gradle can't user JAVA_HOME while debugging from Android Studio

查看:239
本文介绍了从Android Studio调试时,Gradle无法使用JAVA_HOME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在android studio中编译一个项目,它给出了

I'm trying to compile a project in android studio and it gives the

无法使用Gradle发行版' http://services.gradle执行构建.org/distributions/gradle-1.6-bin.zip '.

我已经用红色表示要收集更多我应该使用的信息:

I've already red that to gather more information i should use:

gradlew compileDebug --stacktrace

从主文件夹中

,但是当我这样做时,我得到该错误:

from the main folder, but when i do that i get that error:

JAVA_HOME设置为无效目录:C:\ Program Files(x86)\ Java \ Jre7 \ bin \ java.exe;

JAVA_HOME is set toan invalid directory: C:\Program Files (x86)\Java\Jre7\bin\java.exe;

请注意,我也尝试在JAVA_HOME路径中使用jre的64位版本.

Please note that i tried to use a 64 bit version of the jre too in the JAVA_HOME path.

任何人都可以给我一些帮助吗?

Anyone can give me some help ?

预先感谢

推荐答案

将环境变量 JAVA_HOME 的值更改为 C:\ Program Files(x86)\ Java \ Jre7 \ 而不是 C:\ Program Files(x86)\ Java \ Jre7 \ bin \ java.exe

Change the value of environment variable JAVA_HOME to C:\Program Files (x86)\Java\Jre7\ instead of C:\Program Files (x86)\Java\Jre7\bin\java.exe

JAVA_HOME 应该始终指向其中的JDK或JRE安装的父目录,我们会找到 bin 包含Java,javac等二进制文件的目录

JAVA_HOME should be always pointing to the parent directory of JDK or JRE installation inside of which, we find the bin directory containing the java, javac, etc. binaries

这篇关于从Android Studio调试时,Gradle无法使用JAVA_HOME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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