Gradle build failing after update

Viewed 5935

Getting exception while gradle/gradlew build. Build without test cases is successful. This happening when I updated the gradle to 6.0.1

Works fine for gradle 5.6/6.2 version.

Could not write standard input to Gradle Test Executor 2.
java.io.IOException: The pipe is being closed
 at java.base/java.io.FileOutputStream.writeBytes(Native Method)
 at java.base/java.io.FileOutputStream.write(FileOutputStream.java:348)
 at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
 at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
 at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:68)
 at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
 at java.base/java.lang.Thread.run(Thread.java:835)
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain

FAILURE: Build failed with an exception.
2 Answers

I just had this happen, and found that stopping the gradle daemon resolved it for me:

gradle --stop

or

./gradlew --stop

depending on your setup (the daemon is relaunched when you attempt to build again).

I encountered this error and the one method I found was dump the whole $HOME/.gradle cache and then rebuild the project.

Starting/Stopping IntellijIDEA and/or rebuilding did not help.

You know you have jumped the complexity shark somewhere when running lowly test cases starts to fail for obscure reasons.

Granted, this happened after a machine crash. But still..

Related