./gradlew build error in BASH

I am receiving build error below:

FAILURE: Build failed with an exception.
2021-11-02T10:52:21.265-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':test'.
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.io.EOFException
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2021-11-02T10:52:21.266-0400 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]  Run with --scan to get full insights.

However, when I build with Gradle in Eclipse the build works fine. I am lost as to why this is failing. --scan to get full insights is returning

Using Gradle 6.4.1 Please reply with any ideas or thoughts on this.

What do you mean with “returning”?
Do you mean it does not fail if you run with --scan?
What about if you run with --stacktrace?