导入项目时出错 [英] Error while importing projects
问题描述
在将项目导入到eclipse中时,我有这个错误:
找不到系统Java编译器。确保您已经安装了JDK(不仅仅是JRE),并且将您的JAVA_HOME系统变量配置为指向相应的目录。无法使用Gradle发布执行构建 http://services.gradle.org/distributions /gradle-1.11-all.zip 。
正如我检查过我需要设置JAVA_HOME(我的电脑上有JDK ),但我没有线索如何做到这一点。
我有很多类似的问题,我认为最好的解决方案是手动指定JDK位置。为了做到这一点:
将两个文件添加到项目根文件夹
gradle.properties
:
org.gradle.java.home = C:/ Program Files / Java / jdk1.7.0_03
和 local.properties
:
org.gradle.java.home = C:/ Program Files / Java / jdk1.7.0_03
您应该将 org.gradle.java.home值
更改为系统中的JDK路径。如果你的Android SDK有同样的问题,请将 sdk.dir = / Users / alonzilberman / Android / adt-bundle-mac-x86_64-20130917 / sdk
添加到你的 local.properties
。
添加文件后,刷新gradle build。
While importing projects into eclipse i have this error:
Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.11-all.zip'.
As I have checked i need to set JAVA_HOME (i have the JDK on my computer), but i dont have a clue how to do that.
I had lots of similar problems and I think that the best solution is to specify JDK location manually. In order to do it:
Add two files to project root folder
gradle.properties
:
org.gradle.java.home=C:/Program Files/Java/jdk1.7.0_03
and local.properties
:
org.gradle.java.home=C:/Program Files/Java/jdk1.7.0_03
You should change org.gradle.java.home value
to JDK path in your system. If you will have the same problem with android SDK add sdk.dir=/Users/alonzilberman/Android/adt-bundle-mac-x86_64-20130917/sdk
to your local.properties
.
After adding files refresh gradle build.
这篇关于导入项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!