How can I get ec2 command run in git-bash?

I found a solution here: bash shell does not run .bat files

Run

cmd.exe '/c filename.batorexe' 

in the appropriate directory (you can't do a subfolder for some reason).


The difference is that Git Bash (MINGW) doesn't convert some of the environment variables from Windows path format to *nix path format. It does the conversion for PATH, but not EC2_HOME or CLASSPATH.

I had the same error, then after setting these 2 environment variables in Git Bash, the ec2 command line worked great:

export CLASSPATH="/c/Program Files/ec2-api-tools-1.6.6.3/lib"
export EC2_HOME="/c/Program Files/ec2-api-tools-1.6.6.3"

You can add that to .bash_profile to automatically set it whenever you launch Git Bash (instead of changing the Windows environment variables), that way it will work in both Git Bash and Windows command line.