Forumpy
Forumpy

Reputation: 335

Gradle Wrapper ClassNotFound but only sometimes?

I'm writing a script to extract some zipped files and run their gradle wrappers. At first this worked fine, but now every time I run the script, the zips extract to their directories but I get:

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

I've run gradle wrapper but I get the same problem. My directories are fine (I've got gradle-wrapper.jar and the rest of the files). I've looked at most of the other threads on this problem and none of them have solved it. Why could this be happening and how can I fix it?

Upvotes: 0

Views: 740

Answers (1)

Forumpy
Forumpy

Reputation: 335

I found out that the problem was the naming of the directory:

If the project is extracted to a directory with special characters that need to be escaped (in my case colons (:)), then gradle messes up and can't index the project properly or run the wrapper.

Upvotes: 1

Related Questions