18

当 Gradle STS 扩展在安装了 Gradle STS 扩展后启动 Eclipse 3.7 (Indigo) 后尝试执行我的项目的 gradle 构建脚本时,偶尔我会收到以下错误,

Unable to start the daemon process. The exit value was: 1.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/current/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.0-bin.zip'.

这是我的系统规格:

  • Windows 7 32 位
  • Eclipse 3.7 32 位
  • Java jdk1.7.0_07 32位

这是此插件的已知错误吗?关于如何解决它的任何想法?

4

3 回答 3

34

在 Eclipse 中,转到 Window、Preferences、Gradle、Arguments 并在对话框中添加 gradle jvmargs -Xms128m -Xmx512m

首选项对话框

于 2013-11-04T10:34:44.893 回答
13

听起来有时,您的系统无法保留足够的内存来启动 Gradle 守护程序。项目是否有gradle.properties包含内存设置 ( org.gradle.jvmargs)?或者,你有一个gradle.properties~/.gradle 吗?

于 2012-09-25T15:34:24.390 回答
5

我在导入 Gradle 项目时遇到了同样的问题。(Windows 7 64 位,sts-3.2.0.RELEASE 32 位,Java jdk1.7.0_13 32 位)。


解决了在项目目录(=sts 工作区)中创建gradle.properties文件,内容为: org.gradle.jvmargs=-Xms128m -Xmx512m


请注意,-Xmx=512m 是我可以在我的系统上使用的最大 JVM 内存大小。更大的 Xmx 内存大小会导致所描述的错误。

于 2013-07-17T10:00:54.020 回答