Gradle build failing after update
Asked Answered
G

3

19

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.
Gainey answered 25/2, 2020 at 3:13 Comment(3)
Never seen that before, but a ClassNotFoundException could indicate that your Gradle installation is corrupted somehow. If you have a working version, try running gradle wrapper with that to regenerate the wrapper scripts. If it still doesn't work, try deleting the broken distribution in $HOME/.gradle/wrapper/dists.Domett
anyone found the issue ? I am getting this, and clearing gradle cache, wrapper didn't helpSalford
since this is the underlying issue, can you feature it a little bit more prominently: Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain the answer given is also the appropriate one, so it would be great if it was acceptedJuliettajuliette
C
53

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).

Cony answered 24/9, 2020 at 20:58 Comment(1)
i just hit this issue and this answered absolutely helped, thank you!Vizierate
Q
2

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..

Quartana answered 6/4, 2021 at 14:53 Comment(0)
O
0

If its a windows system, then try deleting the .gradle folder from the user directory and try to build the gradle. This should solve the issue

Opinicus answered 10/10, 2022 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.