. Advertisement .
..3..
. Advertisement .
..4..
I get an error
usr$ ./gradlew tasks
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
When trying to execution of the command ./gradlew. How to fix the error: could not find or load main class org.gradle.wrapper.gradlewrappermain error? Please give me some advice.
The cause: The error: could not find or load main class org.gradle.wrapper.gradlewrappermain indicates that your gradle wrapper is damaged, broken, or missing.
Solution: Restoring gradle wrapper is what should be done for error handling
-With old version, put a
wrapper
task to build.gradle-It is easier with new version of gradle, run:
@RaGe may also have an answer. This is the scenario I encountered where a global Git ignore was running that was disregarding
.jar
files. The gradle wrapper was not being committed. After an unsuccessful/var/lib/jenkins/my_project/gradlew build
, I started getting this error message on my Jenkins server. I had to force the add of the jar, and then commit: