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?

link|improve this question
feedback

3 Answers

Even in git-bash on windows you can enter into CMD mode by typing 'cmd' and then use the commands in normal cmd-way.

So, you could even try that..... this would spare you opening different consoles for different tasks.

link|improve this answer
feedback

Your problem is the class that not is found. Seems your bash shell not has access to the same environment cmd shell has. Set up the right environment and the bash shell should work.

link|improve this answer
How would you go about setting up the environment? Could that be included in your answer? – Simon Sheehan Jan 11 at 20:51
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.