pokero pokero - 1 month ago 11x
Java Question

java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials

I am running the Glacier API for AWS, just a very basic version - trying to list my vaults.

I followed the example at

I am running from the command line on Linux. It compiles fine:

javac -cp sdk/lib/aws-java-sdk-1.7.3.jar -d bin src/

But when running, I get:

java -cp "bin: sdk/lib*" AmazonGlacierVaultInfo

Exception in thread "main" java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentials

It seems the SDK classes in the sdk jar are not being found.

I have my classpath correct though I think:


I run and compile from /home/name/sites/git/glacier, which has bin, src and sdk directories as detailed on

Any help would be greatly appreciated.


A few issues

  • Add a forward slash to parse the contents of your lib directory
  • Remove the space from the classpath
  • the surrounding quotes are unnecessary


java -cp bin:sdk/lib/* AmazonGlacierVaultInfo