<p>Okay,</p>

<p>Answering my own question.</p>

<p>Gradle couldn't find the java installation so I ended up pointing it directly to the JDK I have installed on my computer.</p>

<p>If any other user gets this error without actually running out of memory I suggest adding -XX:+HeapDumpOnOutOfMemoryError to jvmargs this will print a log telling you what went wrong in the java vm itself.</p>

<p>Thanks</p>

CC BY-SA 4.0
2019-02-14T20:55:19.140Z
2019-02-14T20:55:19.140Z
Alex
<p>I am running Jenkins (ver: 2.150.3) with gradle (ver: 4.1)</p>

<p>I am getting an error that says the gradle daemon closed unexpectedly.</p>

<p>Google says it would most likely be gradle running out of memory. So I set the memory to 3000M with no luck.</p>

<p>Now this is a small 1 activity with only around 200 lines of code android app.</p>

<p>I have tried using invoke gradle and by running it through scripts.</p>

<p>It looks as if by running debug, that the workers are conflicting with each other.</p>

<p>Heres the last 20 lines of the output:
`</p>

<pre><code>    ----- Last  20 lines from daemon log file - daemon-4448.out.log -----
09:41:39.303 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:41:39.490 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.42 started (1 worker(s) in use).
09:41:39.490 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution: acquired lock on root.1.10.42
09:41:39.490 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.490 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-mdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.506 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.43 started (2 worker(s) in use).
09:41:39.506 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 2: acquired lock on root.1.10.43
09:41:39.506 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.506 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-hdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.537 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.44 started (3 worker(s) in use).
09:41:39.537 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 3: acquired lock on root.1.10.44
09:41:39.537 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.537 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-xxxhdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.537 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.45 started (4 worker(s) in use).
09:41:39.553 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 4: acquired lock on root.1.10.45
09:41:39.553 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.553 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-xxhdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.568 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.46 could not be started (4 worker(s) in use).
09:41:39.584 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.47 could not be started (4 worker(s) in use).
09:41:39.600 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.48 could not be started (4 worker(s) in use).
----- End of the daemon log -----

09:41:39.709 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:238)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:214)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:178)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:141)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:92)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:287)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:260)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:253)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:182)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.Main.doAction(Main.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at java.lang.reflect.Method.invoke(Method.java:498)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at java.lang.reflect.Method.invoke(Method.java:498)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE`
</code></pre>

<p>Edit: </p>

<p>I've also tried running with max-workers argument but I don't think it took it.</p>

CC BY-SA 4.0
2019-02-14T20:39:43.537Z
Okay so I was looking through another log from java itself and it appears its trying to find jni.cpp in a Cygwin folder. I do not have Cygwin so ill try installing it. That doesn't explain why it worked on the computer and didn't work on Jenkins though.
Alex
<jenkins><gradle>
Jenkins: Gradle daemon closes unexpectedly
Alex
# Jenkins: Gradle daemon closes unexpectedly

(Asked by: username_0 on 2019-02-14)

I am running Jenkins (ver: 2.150.3) with gradle (ver: 4.1)
I am getting an error that says the gradle daemon closed unexpectedly.
Google says it would most likely be gradle running out of memory. So I set the memory to 3000M with no luck.
Now this is a small 1 activity with only around 200 lines of code android app.
I have tried using invoke gradle and by running it through scripts.
It looks as if by running debug, that the workers are conflicting with each other.
Heres the last 20 lines of the output:
`
    ----- Last  20 lines from daemon log file - daemon-4448.out.log -----
09:41:39.303 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
09:41:39.490 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.42 started (1 worker(s) in use).
09:41:39.490 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution: acquired lock on root.1.10.42
09:41:39.490 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.490 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-mdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.506 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.43 started (2 worker(s) in use).
09:41:39.506 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 2: acquired lock on root.1.10.43
09:41:39.506 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.506 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-hdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.537 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.44 started (3 worker(s) in use).
09:41:39.537 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 3: acquired lock on root.1.10.44
09:41:39.537 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.537 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-xxxhdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.537 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.10.45 started (4 worker(s) in use).
09:41:39.553 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Worker Daemon Execution Thread 4: acquired lock on root.1.10.45
09:41:39.553 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction' started
09:41:39.553 [INFO] [com.android.build.gradle.tasks.MergeResources] Generating PNG: [C:\Program Files (x86)\Jenkins\workspace\pu\app\build\generated\res\pngs\debug\drawable-xxhdpi\ic_launcher_background.png] from [C:\Program Files (x86)\Jenkins\workspace\pu\app\src\main\res\drawable\ic_launcher_background.xml]
09:41:39.568 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.46 could not be started (4 worker(s) in use).
09:41:39.584 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.47 could not be started (4 worker(s) in use).
09:41:39.600 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Build operation root.1.10.48 could not be started (4 worker(s) in use).
----- End of the daemon log -----

09:41:39.709 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.launcher.daemon.client.DaemonDisappearedException: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.handleDaemonDisappearance(DaemonClient.java:238)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:214)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:178)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:141)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:92)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:287)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:260)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:253)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:182)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.Main.doAction(Main.java:33)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at java.lang.reflect.Method.invoke(Method.java:498)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at java.lang.reflect.Method.invoke(Method.java:498)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]   at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
09:41:39.725 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE`

Edit: 
I've also tried running with max-workers argument but I don't think it took it.

**Tags:** jenkins, gradle

> **Comments:**
> **username_0**: Okay so I was looking through another log from java itself and it appears its trying to find jni.cpp in a Cygwin folder. I do not have Cygwin so ill try installing it. That doesn't explain why it worked on the computer and didn't work on Jenkins though.  

---

## 1 answers

### Answer by username_0 on 2019-02-14. Score: 1

Okay,

Answering my own question.

Gradle couldn't find the java installation so I ended up pointing it directly to the JDK I have installed on my computer.

If any other user gets this error without actually running out of memory I suggest adding -XX:+HeapDumpOnOutOfMemoryError to jvmargs this will print a log telling you what went wrong in the java vm itself.

Thanks


---

