Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run gradlew clean But I am facing following error gradlew: command not found in Java. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How gradlew: command not found Error Occurs ?
I am trying to run gradlew clean But I am facing following error.
/gradlew clean
./gradlew: line 165: *.domain1.tld: command not found
./gradlew: line 165: *.domain2.tld: command not found
Error: Could not find or load main class clean
No command ‘gradlew’ found, did you mean: Command ‘gradle’ from package ‘gradle’ (universe) gradlew: command not found
How To Solve gradlew: command not found Error ?
- How To Solve gradlew: command not found Error ?
To Solve gradlew: command not found Error If you are using mac, try giving root access to gradlew by doing chmod +x ./gradlew Now Your error must be solved. And If You are using Windows then Just run this command in your Windows Powershell. Adding the
./
tells it to look in the current directory since it isn’t in the path. .\gradlew Now Your error must be solved. - gradlew: command not found
To Solve gradlew: command not found Error If you are using mac, try giving root access to gradlew by doing chmod +x ./gradlew Now Your error must be solved. And If You are using Windows then Just run this command in your Windows Powershell. Adding the
./
tells it to look in the current directory since it isn’t in the path. .\gradlew Now Your error must be solved.
Solution 1: Try chmod +x gradlew for macOS
If you are using mac, try giving root access to gradlew by doing
chmod +x ./gradlew
Now Your error must be solved
Solution 2: Try .\gradlew for windows
If You are using Windows then Just run this command in your Windows Powershell. Adding the ./
tells it to look in the current directory since it isn’t in the path.
.\gradlew
Now Your error must be solved.
Solution 3: try to built Gradle wrapper
First of all Gradle wrapper needs to be built So that Just run this command to built Gradle wrapper with this command.
gradle wrapper --gradle-version 2.13 # Here Your Gradle Version ( In my case it is 2.13 )
Just After running this command, you should see new scripts added to your project folder. Now You are able to run wrapper with this command.
./gradlew build
Now, Your error should be solved.
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read