Experiencing an error when trying to build some robot code, both me and my mentor aren't sure what's causing it

Experiencing an error when trying to build some robot code, both me and my mentor aren’t sure what’s causing it:

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

  • The terminal process “cmd.exe /d /c gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2023\jdk”” terminated with exit code: 1.
  • Terminal will be reused by tasks, press any key to close it.

This is a long shot, but is there a space in the path to your project? Windows does not care about spaces, but WpiLib (probably really gradle) does. The error we got when we had this was similar.

Edit: It is not just spaces. Many special characters will break things specifically apostrophes.

We got an error either similar or exactly the same as this a while back. Our issue was that the gradle-wrapper.jar file in gradle/wrapper was missing.

This error would occur if the gradle-wrapper.jar in ./gradle/wrapper is missing or corrupted. Did you delete this folder from your project? Perhaps something like *.jar was added to your .gitignore before you pulled from git?

If the file got removed, you can copy the gradle folder from a freshly created project.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.