I\'ve installed gradle on MAC using terminal.
gradle
brew install gradle
Gradle has been installed successfully.
gradle -v --
On Mojave (v10.14), Gradle v5.4, I had to append libexec after Gradle version for IntelliJ to work.
libexec
/usr/local/Cellar/gradle/5.4/libexec