Software⏱️ 2 min read📅 2026-05-31

How to Fix: Error message "gradlew: command not found"

Gradle Wrapper not found error on Ubuntu Linux.

Quick Answer: Check if the Gradle Wrapper is correctly configured by running "gradlew --version". If it's not present, try reinstalling Gradle using "sudo apt-get install gradle -y" and then run "gradlew --version" again.

The error message 'gradlew: command not found' indicates that the Gradle Wrapper is not properly configured on your Ubuntu Linux system. This can occur due to various reasons such as incorrect installation, missing dependencies, or a mismatch between the Gradle version used by the wrapper and the JDK.

💡 Why You Are Getting This Error

  • When you installed Gradle using sudo apt-get install gradle, it may not have included the Gradle Wrapper, which is a crucial component for running Gradlew.

🔧 Proven Troubleshooting Steps

Method 1: Update Gradle Wrapper

  1. Step 1: Run sudo ./gradlew wrapper to update the Gradle Wrapper.

Method 2: Verify JDK Version

  1. Step 1: Check if the JDK version matches the Gradle Wrapper version. You can do this by running gradlew --version. If the versions don't match, update the JDK to the recommended version.

💡 Conclusion

To resolve the 'gradlew: command not found' error, try updating the Gradle Wrapper or verifying that the JDK version matches the Gradle Wrapper version. If you're still experiencing issues, consider reinstalling Gradle using the Gradle Wrapper.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions