title: Unable to initialize main class, Caused by: java.lang.NoClassDefFoundError: com/mashape/unirest/http/exceptions/UnirestException [JAVA]
body: <p><strong>PROBLEM</strong></p>
  
  <p>After I run the Maven 'compile', 'install' command in Eclipse to create an executable JAR and proceed to run that JAR I get the below error</p>
  
  <p><code>Error: Unable to initialize main class org.example.project.StockTracker`
  Caused by: java.lang.NoClassDefFoundError: com/mashape/unirest/http/exceptions/UnirestException</code></p>
  
  <p>I have no clue what is going on. How can I resolve this? Below are some further details. I updated the POM with the main-class information and set the classpath to 'true'. </p>
  
  <p><strong>MAIN CLASS CODE</strong></p>
  
  <pre><code>package org.example.project;
  
  import com.mashape.unirest.http.HttpResponse;
  import com.mashape.unirest.http.Unirest;
  import com.mashape.unirest.http.exceptions.UnirestException;
  
  public class StockTracker {
  
      public static void main (String[] args) throws UnirestException, InterruptedException  {
          HttpResponse&lt;String&gt; response = Unirest.get("https://apidojo-yahoo-finance-v1.p.rapidapi.com/market/get-quotes?region=US&amp;lang=en&amp;symbols=TSLA")
                      .header("x-rapidapi-host", "apidojo-yahoo-finance-v1.p.rapidapi.com")
                      .header("x-rapidapi-key", "api-key")
                      .asString();
  
          //System.out.println(response.getBody());
          System.out.println("response.getBody()");
      }
  }
  </code></pre>
  
  <p><strong>UNIREST EXCEPTION CLASS CODE</strong></p>
  
  <pre><code>package com.mashape.unirest.http.exceptions;
  
  public class UnirestException extends Exception {
  
      private static final long serialVersionUID = -3714840499934575734L;
  
      public UnirestException(Exception e) {
          super(e);
      }
  
      public UnirestException(String msg) {
          super(msg);
      }
  
  }
  </code></pre>
  
  <p><strong>MANIFEST-FILE IN JAR</strong></p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Created-By: Apache Maven 3.6.3
  Built-By: Author
  Build-Jdk: 13.0.1
  Class-Path: unirest-java-1.4.9.jar httpclient-4.5.2.jar httpcore-4.4.4.j
   ar commons-logging-1.2.jar commons-codec-1.9.jar httpasyncclient-4.1.1.
   jar httpcore-nio-4.4.4.jar httpmime-4.5.2.jar json-20160212.jar
  Main-Class: org.example.project.StockTracker
  </code></pre>