Why does gradle not run in the Terminal Window in IntelliJ IDEA?

You should add the directory containing gradle.bat to PATH and restart IntelliJ IDEA.

The full path can look like this: d:\dev\gradle-3.5\bin.


IntelliJ IDEA uses the Gradle Wrapper or the Gradle distributed location that you specify in your IntelliJ IDEA settings, but when you are using the terminal window, it uses your native operating system command line, so if you don't have Gradle configured in your PATH environment variable, it will just not work because it doesn't know what gradle is.

Add gradle to your path in:

Windows

In File Explorer right-click on the This PC (or Computer) icon, then click Properties -> Advanced System Settings -> Environmental Variables.

Under System Variables select Path, then click Edit.
Add an entry for C:\Gradle\gradle-3.5\bin. Click OK to save.

Linux / Mac

export PATH=$PATH:/opt/gradle/gradle-3.5/bin