IBM Support

Git is not on my PATH when using the Cordova Terminal outside of Rational Application Developer

Troubleshooting


Problem

The Git command is not found even though you are sure that Git is in your PATH and you can run it in a Terminal that is opened outside of IBM Rational Application Developer.

Cause

When Opening the Terminal using the project's context menu Cordova -> Open in Terminal (in Rational Application Developer 9.1 it is located in the project's context menu and Open in Terminal) Rational Application Developer configures the PATH with the following values in this order:

  1. Cordova location: Configured in workspace preferences > Cordova > General tab
  2. Platform requirements
    1. For Android
      • Oracle JDK bin folder
      • Android SDK tools and platform-tools folders
      • Ant bin folder
    2. For iOS
      • XCode location
  3. Minimal locations for OS in PATH
    1. For Windows
      • %SystemRoot%
      • %SystemRoot%\system32
    2. For Linux and Mac
      • /usr/local/sbin
      • /usr/local/bin
      • /sbin
      • /bin
      • /usr/sbin
      • /usr/bin

If the Git command, or any other command that is to be executed in this Terminal, the Git functionality is not in any of these locations then it will not be found and fail to execute.

Diagnosing The Problem

When running Git command in the Terminal opened by Rational Application Developer, the output is "git: command not found"

Resolving The Problem

Make sure you add Git location in the PATH. For this, add the following in the Terminal window prior running the git command

  • Microsoft Windows
    > PATH=C:\Program Files\Git\cmd;%PATH%
  • Linux and Mac
    $ PATH="/opt/git/bin:$PATH"


Note that the locations depicted above might not match with your installation, therefore you need to check the install location before adding it to the PATH

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Cordova","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"},{"code":"PF033","label":"Windows"}],"Version":"9.1;9.1.0.1;9.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS4JCV","label":"Rational Software Architect for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SSPSQF","label":"Rational Developer for AIX and Linux"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSAE4W","label":"Rational Developer for i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"Modernization Tools- Java Edition","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
10 September 2020

UID

swg21687322