简体   繁体   中英

Gradle is getting unknown JVM options

When I'm trying to import a gradle project to eclipse IDE I'm getting this error:

I don't know why it's getting me errors like:

Error: Could not create the Java Virtual Machine.

Error: Invalid maximum heap size: -Xmx4g

I've never specified options like -Xmx4g . I don't know where are they got from?

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.

The problem seems to be Invalid maximum heap size: -Xmx4g .

Check this answer for more on max size to be set Maximum Java heap size of a 32-bit JVM on a 64-bit OS

It seems like a Gradle Daemon issue.

You can configure it by including the following line into your gradle.properties :

org.gradle.jvmargs=-Xmx512m

Let me know how it goes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM