In Java track, using WLS2, Gradle test fails with non-zero exit value 1

Hi,

Wondering if any kind soul could help figure out how to get gradle test to work?

The error message I get running gradle test for Java track’s Blackjack exercise in WSL2 is as follows:

Running gradle test --info:

kiki@DESKTOP-NHAMNB1:~/exercism/java/blackjack
$ gradle test --info
Initialized native services in: /home/kiki/.gradle/native
Initialized jansi services in: /home/kiki/.gradle/native
Received JVM installation metadata from ‘/usr/lib/jvm/java-11-openjdk-amd64’: {JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64, JAVA_VERSION=11.0.17, JAVA_VENDOR=Ubuntu, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=11.0.17+8-post-Ubuntu-1ubuntu220.04, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=11.0.17+8-post-Ubuntu-1ubuntu220.04, VM_VENDOR=Ubuntu, OS_ARCH=amd64}
The client will now receive all logging from the daemon (pid: 6059). The daemon log file: /home/kiki/.gradle/daemon/7.6/daemon-6059.out.log
Starting 20th build in daemon [uptime: 1 hrs 29 mins 39.055 secs, performance: 100%, non-heap usage: 29% of 256 MiB]
Using 8 worker leases.
Now considering [/home/kiki/exercism/java/blackjack, /home/kiki/exercism/java/annalyns-infiltration] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file ‘/home/kiki/exercism/java/blackjack/settings.gradle’.
Projects loaded. Root project using build file ‘/home/kiki/exercism/java/blackjack/build.gradle’.
Included projects: [root project ‘blackjack’]

Configure project :
Evaluating root project ‘blackjack’ using build file ‘/home/kiki/exercism/java/blackjack/build.gradle’.
All projects evaluated.
Task name matched ‘test’
Selected primary task ‘test’ from project :
Tasks to be executed: [task ‘:compileJava’, task ‘:processResources’, task ‘:classes’, task ‘:compileTestJava’, task ‘:processTestResources’, task ‘:testClasses’, task ‘:test’]
Tasks that were excluded:
Resolve mutations for :compileJava (Thread[Execution worker,5,main]) started.
:compileJava (Thread[Execution worker,5,main]) started.

Task :compileJava UP-TO-DATE
Caching disabled for task ‘:compileJava’ because:
Build cache is disabled
Skipping task ‘:compileJava’ as it is up-to-date.
Resolve mutations for :processResources (Thread[Execution worker,5,main]) started.
:processResources (Thread[Execution worker,5,main]) started.

Task :processResources NO-SOURCE
Skipping task ‘:processResources’ as it has no source files and no previous output files.
Resolve mutations for :classes (Thread[Execution worker,5,main]) started.
:classes (Thread[Execution worker,5,main]) started.

Task :classes UP-TO-DATE
Skipping task ‘:classes’ as it has no actions.
Resolve mutations for :compileTestJava (Thread[Execution worker,5,main]) started.
:compileTestJava (Thread[Execution worker,5,main]) started.

Task :compileTestJava UP-TO-DATE
Caching disabled for task ‘:compileTestJava’ because:
Build cache is disabled
Skipping task ‘:compileTestJava’ as it is up-to-date.
Resolve mutations for :processTestResources (Thread[Execution worker,5,main]) started.
:processTestResources (Thread[Execution worker,5,main]) started.

Task :processTestResources NO-SOURCE
Skipping task ‘:processTestResources’ as it has no source files and no previous output files.
Resolve mutations for :testClasses (Thread[Execution worker,5,main]) started.
:testClasses (Thread[Execution worker,5,main]) started.

Task :testClasses UP-TO-DATE
Skipping task ‘:testClasses’ as it has no actions.
Resolve mutations for :test (Thread[Execution worker,5,main]) started.
producer locations for task group 0 (Thread[Execution worker,5,main]) started.
:test (Thread[Execution worker,5,main]) started.

Task :test FAILED
Caching disabled for task ‘:test’ because:
Build cache is disabled
Task ‘:test’ is not up-to-date because:
Task has failed previously.
Watching 38 directories to track changes
Watching 37 directories to track changes
Starting process ‘Gradle Test Executor 14’. Working directory: /home/kiki/exercism/java/blackjack Command: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dorg.gradle.internal.worker.tmpdir=/home/kiki/exercism/java/blackjack/build/tmp/test/work -Dorg.gradle.native=false @/home/kiki/.gradle/.tmp/gradle-worker-classpath5537292476934244133txt -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain ‘Gradle Test Executor 14’
Successfully started process ‘Gradle Test Executor 14’
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
Watching 38 directories to track changes
Watching 39 directories to track changes
Watching 40 directories to track changes

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:test’.

Process ‘Gradle Test Executor 14’ finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 581ms
3 actionable tasks: 1 executed, 2 up-to-date