I am working on a Java project with gradlew. I use Ubuntu Linux as my OS. When I run "gradle" it runs, and gives me info. But when I run "gradlew", it outputs as "No command 'gradlew' found, did you mean:
Command 'gradle' from package 'gradle' (universe)
gradlew: command not found"
I did my research, I have jdk, and I did sudo apt-get install gradle. I am totally clueless
Gradle wrapper needs to be built. Try running gradle wrapper --gradle-version 2.13
Remember to change 2.13 to your gradle version number. After running this command, you should see new scripts added to your project folder. You should be able to run the wrapper with ./gradlew build
to build your code. Please refer to this guid for more information https://spring.io/guides/gs/gradle/.
Linux / MacOS
As noted in the comments, just running
./gradlew
worked for me. Adding the ./
tells it to look in the current directory since it isn't in the path.
Windows PowerShell
.\gradlew
Running this bash command works for me by running chmod 777 gradlew
as sometimes file properties changed when move from one OS to another (Windows, Linux and Mac).
the same problem occurs to me...
I check the file wrx permissions with:
$ls -l ./gradlew
-> -rw-rw-r-- (no execute permission)
so I use command $chmod +x ./gradlew
and this problem solved.
From mac,
Nothing is working except the following command
chmod 777 gradlew
Then
./gradlew
First thing is you need to run the gradle task that you mentioned for this wrapper. Ex : gradle wrapper
After running this command, check your directory for gradlew and gradlew.bat files. gradlew is the shell script file & can be used in linux/Mac OS. gradlew.bat is the batch file for windows OS. Then run,
./gradlew build
(linux/mac). It will work.
I use intellj idea and in windows in terminal type:
gradlew.bat run
it is working for me.