0

当我尝试将 gradle 项目导入 Eclipse IDE 时,出现此错误:

我不知道为什么它会让我出现以下错误:

错误:无法创建 Java 虚拟机。

错误:最大堆大小无效:-Xmx4g

我从未指定过像-Xmx4g. 我不知道他们是从哪里得到的?

Synchronize Gradle projects with workspace failed due to an error connecting 
to the Gradle build.
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.3.1-bin.zip'.

Unable to start the daemon process.
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 https://docs.gradle.org/4.3.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=4g; support was removed in 8.0
Invalid maximum heap size: -Xmx4g
The specified size exceeds the maximum representable size.
4

2 回答 2

1

问题似乎是 Invalid maximum heap size: -Xmx4g 。

检查此答案以获取有关要设置的最大大小的更多信息64 位操作系统上 32 位 JVM 的最大 Java 堆大小

于 2017-11-21T08:46:42.170 回答
1

这似乎是一个 Gradle 守护进程问题。

您可以通过在您的 : 中包含以下行来配置它gradle.properties

org.gradle.jvmargs=-Xmx512m

让我知道事情的后续。

于 2017-11-21T12:52:31.333 回答