Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
The Gradle wrapper JAR (gradle/wrapper/gradle-wrapper.jar) is missing or corrupt.
Seen on:
Java
Meaning
gradlew needs gradle-wrapper.jar. It’s often excluded by .gitignore (*.jar) or not committed, so fresh clones and CI fail.
Common causes
- gradle-wrapper.jar not committed (ignored by *.jar)
- Corrupted download
- Running gradlew from the wrong directory
⚡ Quick fix
- Regenerate: gradle wrapper (with a local Gradle)
- Commit gradle/wrapper/gradle-wrapper.jar and add a .gitignore exception
Detailed fix by platform
Java
.gitignore:!gradle/wrapper/gradle-wrapper.jar
How to diagnose
- File — Does gradle/wrapper/gradle-wrapper.jar exist?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026