Unable start daemon process

Hey Everyone, I’m really hoping I can get some help.
I’ve been trying to mod a Minecraft client recently, I was told to run a gradlew genIntellijRuns command in my command prompt on windows 10. But whenever I run it it’s supposed to say something like “build successful”. But Instead, I get this.
From terminal:
C:\Users\matix\OneDrive\Obrazy\Minecraft Forge\forge-1.12.2-14.23.5.2859-mdk\forge-1.12.2-14.23.5.2859-mdk (1)>gradlew genIntellijRuns
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: The Gradle Daemon - Gradle User Manual.

FAILURE: Build failed with an exception.

  • What went wrong:
    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 The Gradle Daemon - Gradle User Manual
    Please read the following process output to find out more:

FAILURE: Build failed with an exception.

  • What went wrong:
    java.lang.ExceptionInInitializerError (no error message)

  • Try:

From IntelliJ:
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 The Gradle Daemon - Gradle User Manual
Please read the following process output to find out more:

Error occurred during initialization of VM
Could not reserve enough space for 3145728KB object heap


Check the JVM arguments defined for the gradle process in:

  • gradle.properties in project root directory

From IntelliJ if i add more memory:
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 The Gradle Daemon - Gradle User Manual
Please read the following process output to find out more:

Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


Check the JVM arguments defined for the gradle process in:

  • gradle.properties in project root directory

It appears you have installed a 32-bit JVM instead of a 64-bit JVM. The default size it’s trying to use is within the representable size for 32-bit, but it’s still more than can be allocated for the heap in practice. Setting -Xmx to 4G is opposite of what the first error is telling you to do. You might have success if you reduce -Xmx to closer to 1G rather than increase it. However, unless the hardware is pretty old and actually limited, you probably just want to install a 64-bit JVM.