Windows – How to get ec2 command run in git-bash

amazon ec2command linegit-bashwindows 7

I installed ec2 command line tools on windows this morning. When I try to run a command ec2-describe-instances in the git bash, I get this output:

Exception in thread "main" java.lang.NoClassDefFoundError: com/amazon/aes/webservices/client/cmd/DescribeInstances
Caused by: java.lang.ClassNotFoundException: 
com.amazon.aes.webservices.client.cmd.DescribeInstances
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.amazon.aes.webservices.client.cmd.DescribeInstances. 
Program will exit.

But if I open up just standard cmd, everything works fine. I want to be able to use my git bash for everything. I noticed that the git bash just uses the cmd prompt but with extra options. The shortcut for the git bash has this in the target:

C:\Windows\System32\cmd.exe /c ""C:\Program Files\Git\bin\sh.exe" –login -i"

How can I get ec2 command line tools running in the git bash?

Best Answer

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).

Related Question