Cannot run git - error when submitting pre-checkin code review
When setting up a pre-checkin code review with kwcodereview in Eclipse, you may receive the following error:
Cannot run program "git"; the system cannot find the file. Check the system path.
The Klocwork plug-in for Eclipse uses the "git" command to create a code review for git projects. For this to work, the git command-line tool must be installed and the command must be in the system path (the PATH variable).
If Eclipse is launched from a Mac application launcher, it does not obtain PATH set in the shell config file (such as ~/.bashrc ).
To fix this issue, do one of the following:
- Install git into the system directory (for example, /usr/bin ), or
- Install git in another location with a soft link such as /usr/bin/git pointing to the actual git command, or
- Set the user PATH variable in the ~/.MacOSX/environment.plist file