Gradle is installed at C:\Gradle\bin but is NOT in your PATH.
Use the full path to gradle.bat:
C:\Gradle\bin\gradle tasks
C:\Gradle\bin\gradle info
C:\Gradle\bin\gradle verify
C:\Gradle\bin\gradle releaseExample:
cd D:\Bearsampp-dev\dev
C:\Gradle\bin\gradle infoRight-click PowerShell → "Run as Administrator"
cd D:\Bearsampp-dev\dev
.\add-gradle-to-path.ps1Close and reopen PowerShell (or restart your computer)
gradle --version
gradle tasksNow you can use gradle from anywhere!
If the script doesn't work, add manually:
- Press
Win + X→ System - Click "Advanced system settings"
- Click "Environment Variables"
- Under "System variables", find "Path"
- Click "Edit"
- Click "New"
- Add:
C:\Gradle\bin - Click "OK" on all dialogs
- Restart PowerShell
# Information
C:\Gradle\bin\gradle tasks
C:\Gradle\bin\gradle info
C:\Gradle\bin\gradle verify
C:\Gradle\bin\gradle --version
# Build Setup
C:\Gradle\bin\gradle initDirs
C:\Gradle\bin\gradle loadLibs
C:\Gradle\bin\gradle loadAntLibs
# Build & Clean
C:\Gradle\bin\gradle clean
C:\Gradle\bin\gradle build
C:\Gradle\bin\gradle release# Information
gradle tasks
gradle info
gradle verify
gradle --version
# Build Setup
gradle initDirs
gradle loadLibs
gradle loadAntLibs
# Build & Clean
gradle clean
gradle build
gradle releaseAdd this to your PowerShell profile for current session:
# Create alias for current session
Set-Alias -Name gradle -Value C:\Gradle\bin\gradle.bat
# Now you can use:
gradle tasks
gradle infoTo make it permanent, add to your PowerShell profile:
# Open profile
notepad $PROFILE
# Add this line:
Set-Alias -Name gradle -Value C:\Gradle\bin\gradle.bat
# Save and restart PowerShellProblem: Gradle not in PATH
Solutions:
- Use full path:
C:\Gradle\bin\gradle tasks - Add to PATH (see above)
- Create alias (see above)
Problem: Wrong directory
Solution:
cd D:\Bearsampp-dev\dev
C:\Gradle\bin\gradle tasksProblem: PowerShell execution policy
Solution:
# Run as Administrator
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
.\add-gradle-to-path.ps1For immediate use:
C:\Gradle\bin\gradle tasksFor permanent solution:
- Run
.\add-gradle-to-path.ps1as Administrator - Restart PowerShell
- Use
gradlecommands normally
Check if Gradle is in PATH:
# Check PATH
$env:PATH -split ';' | Select-String -Pattern 'Gradle'
# If it shows C:\Gradle\bin, you're good!
# If nothing shows, Gradle is not in PATHTest Gradle:
# With full path (always works)
C:\Gradle\bin\gradle --version
# Without path (only works if in PATH)
gradle --version| Method | Command | When to Use |
|---|---|---|
| Full Path | C:\Gradle\bin\gradle tasks |
Works immediately, no setup |
| Add to PATH | gradle tasks |
After running setup script |
| Alias | gradle tasks |
Quick fix for current session |
Current Status: Gradle NOT in PATH
Quick Fix: Use C:\Gradle\bin\gradle commands
Permanent Fix: Run .\add-gradle-to-path.ps1 as Administrator