当我尝试将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.
答案 0 :(得分:1)
问题似乎是无效的最大堆大小:-Xmx4g。
检查此答案,了解有关设置最大尺寸的更多信息Maximum Java heap size of a 32-bit JVM on a 64-bit OS
答案 1 :(得分:0)
这似乎是Gradle Daemon问题。
您可以通过在gradle.properties
中添加以下内容来配置它:
org.gradle.jvmargs=-Xmx512m
让我知道它是怎么回事。