In my case (using windows 10) gradlew.bat has the following lines of code in:
set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME%
The APP_HOME variable is essentially the root folder with the gradient for the project, so if it gets messed up somehow, you will get:
Error: could not find or load the main class org.gradle.wrapper.GradleWrapperMain
This was ruined for me because there was an ampersand (&) in my project folder structure. For example, C: \ Test & Dev \ MyProject
So gradel tried to find the gradle -wrapper.jar file in the root folder C: \ Test (undoing everything after and including "&")
I found this by adding the following line below the installed line APP_HOME =% DIRNAME% above. Then ran the bat file to see the result.
echo "%APP_HOME%"
A few more βspecial charactersβ will appear that may break the path / directory.
Neil Watson Nov 04 '16 at 19:20 2016-11-04 19:20
source share