Skip to content

About gradle jvm args conflict problem: Unknown command-line option '-X'. #4176

Closed

Description

@crazyde21

settings.json
"java.import.gradle.jvmArguments": "-Xmx4g"

When import project, gradle status: Build Error :

[info] Java Home: C:\Program Files\Java\jdk-1.8 [info] JVM Args: --add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-Xmx4g,-Dfile.encoding=UTF-8,-Duser.country=CN,-Duser.language=zh,-Duser.variant [info] Gradle User Home: C:\Users\CrazyAwei\.gradle [info] Gradle Version: 5.3 [error] Error getting build for c:\workSpace\sp-erp: Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-5.3-bin.zip'. Problem with provided build arguments: [--init-script, C:\Users\CRAZYA~1\AppData\Local\Temp\6a04067a73fb07ce3752317f20560b6b753f9e355f8679fa62e3e68e92af6797.gradle, -Xmx4g]. Unknown command-line option '-X'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class. [info] Found 0 tasks [info] [gradle-server] [ERROR] Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-5.3-bin.zip'. Problem with provided build arguments: [--init-script, C:\Users\CRAZYA~1\AppData\Local\Temp\6a04067a73fb07ce3752317f20560b6b753f9e355f8679fa62e3e68e92af6797.gradle, -Xmx4g]. Unknown command-line option '-X'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class.

Activity

  1. crazyde21 commented on Sep 26, 2025

    @crazyde21
    Author

    if don't set "java.import.gradle.jvmArguments": "-Xmx4g"

    When i run gradle build it throw OOM exception

  2. crazyde21 commented on Sep 26, 2025

    @crazyde21
    Author

    I have to unset "java.import.gradle.jvmArguments": "-Xmx4g" until project import done, and set it again to run gradle task to build.

  3. changed the title [-]Unknown command-line option '-X'.[/-] [+]About gradle jvm args conflict probleam: Unknown command-line option '-X'.[/+] on Sep 26, 2025
  4. changed the title [-]About gradle jvm args conflict probleam: Unknown command-line option '-X'.[/-] [+]About gradle jvm args conflict problem: Unknown command-line option '-X'.[/+] on Sep 26, 2025
  5. fbricon commented on Sep 26, 2025

    @fbricon
    Collaborator

    Try adding

    org.gradle.jvmargs=-Xmx4g

    to your /gradle.properties

  6. crazyde21 commented on Sep 26, 2025

    @crazyde21
    Author

    Try adding

    org.gradle.jvmargs=-Xmx4g

    to your /gradle.properties

    it work!!! thanks

    i create it in my /Users/.gradle/gradle.properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions