3

I am trying to add Gradle to my PATH. I have used the command

export PATH=/myUsername/Applications/gradle-2.6/bin:$PATH

but when I type

gradle

I get an error "command not found." So I went to look for .profile or .bash_profile, but neither file existed. So I created .bash_profile, and added the line

export PATH=/myUsername/Applications/gradle-2.6/bin:$PATH

This still did not work, and I have no idea what to do from here. When I type $PATH, I see the lines added, so I have no idea why it isn't working. Any help would be appreciated.

2 Answers 2

3

The path /myusername/Applications/gradle-2.6/bin probably doesn't exist except your personal user folder is in the root of your main volume - which would be very, very uncommon on a *nix system.

Depending on where you've installed Gradle the proper path might be:

/Users/myUsername/Applications/gradle-2.6/bin or
/Applications/gradle-2.6/bin

So change the export line to

export PATH=/Users/myUsername/Applications/gradle-2.6/bin:$PATH or  
export PATH=/Applications/gradle-2.6/bin:$PATH
0

Personally I'd not place it forward of the system's $PATH and do it as such.

export PATH=$PATH:$HOME/Applications/gradle-2.6/bin

If you want it first in the $PATH, then use:

 export PATH=$HOME/Applications/gradle-2.6/bin:$PATH

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .