# GradleWorkerMain error while building

**URL:** <https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020>\
**Category:** Help/Discuss\
**Created:** [September 20, 2021, 6:22am UTC](https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020 "2021-09-20T06:22:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pin34ppl3](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pin34ppl3](https://discuss.gradle.org/u/pin34ppl3)\
**Post date:** [September 20, 2021, 6:22am UTC](https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020/1 "2021-09-20T06:22:41Z")

</div>

I ran into a problem after my work project was updated to Java 11 and to Gradle 7.2. I have tried to delete-reinstall both to no result.

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

This happens when gradle build task gets to tests

The error is not because of IDE, I also get it with running from terminal.

Regenerating wrapper did not help, deleting the user gradle file did not either.

Windows 10 machine, if that changes anything.

---

<div class="post-metadata">

**Author:** ![pin34ppl3](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pin34ppl3](https://discuss.gradle.org/u/pin34ppl3)\
**Post date:** [September 27, 2021, 6:56am UTC](https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020/2 "2021-09-27T06:56:45Z")

</div>

Still looking for a solution!

---

<div class="post-metadata">

**Author:** ![catkkt](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@catkkt](https://discuss.gradle.org/u/catkkt)\
**Post date:** [July 6, 2023, 1:49am UTC](https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020/3 "2023-07-06T01:49:07Z")

</div>

Hi，there is the same situation when I use javaagent-shadowJar. Have you resolved it yet?

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [July 6, 2023, 7:33am UTC](https://discuss.gradle.org/t/gradleworkermain-error-while-building/41020/4 "2023-07-06T07:33:17Z")

</div>

Can you share a build `--scan`?
