title: Class not found: com.amazonaws.auth.CredentialsProvider
body: <p>I am trying to incorporate AWS Lambda using Java 8, but when I upload my function to lambda, the class fails to load and I get the following stack trace:</p>
  
  <pre><code>Error loading class com.treyherman.lambda.GifLambdaHandler: com/amazonaws/auth/AWSCredentialsProvider: class java.lang.NoClassDefFoundError
  java.lang.NoClassDefFoundError: com/amazonaws/auth/AWSCredentialsProvider
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:348)
  Caused by: java.lang.ClassNotFoundException: com.amazonaws.auth.AWSCredentialsProvider
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  ... 2 more
  </code></pre>
  
  <p>Here is my Maven depencies in pom.xml:</p>
  
  <pre><code>    &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
        &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
        &lt;groupId&gt;com.myname.lambda&lt;/groupId&gt;
        &lt;artifactId&gt;demo&lt;/artifactId&gt;
        &lt;version&gt;4.0.0&lt;/version&gt;
        &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
        &lt;artifactId&gt;aws-lambda-java-core&lt;/artifactId&gt;
        &lt;version&gt;1.1.0&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
        &lt;artifactId&gt;aws-lambda-java-events&lt;/artifactId&gt;
        &lt;version&gt;1.3.0&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.11&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
        &lt;artifactId&gt;aws-java-sdk&lt;/artifactId&gt;
        &lt;version&gt;1.11.110&lt;/version&gt;
        &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.bytedeco&lt;/groupId&gt;
      &lt;artifactId&gt;javacv-platform&lt;/artifactId&gt;
      &lt;version&gt;1.3.2&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
      &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
      &lt;version&gt;1.3.2&lt;/version&gt;
  &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I have read something about the separate jar files in AWS not compiling correctly when I make my file into a jar, but I cannot figure out how to do that. </p>
  
  <p>If anybody knows the solution or has an idea of how to solve it, it'd be much appreciated</p>