title: Executable jar file error
body: <p>Hey there i am developing java application. 
  I completed coding part but i am recieving <code>exception in thread main java.lang.noclassdeffounderror</code> when i ran it. I have searched this through the internet, and could not find suitable answer.</p>
  
  <p>Let me explain what i have done before exporting java program to the executable jar file from eclipse:</p>
  
  <ul>
  <li><p>I added some jar files to my library so my program could connect a 3rd party program. It runs from a custom Jre which is named SSC and
  got location in 3rd party program's(SunSystems) location folder. </p></li>
  <li><p>I wrote the required java code to run the program.</p></li>
  <li><p>Then i ran the project, which works perfectly when i run from eclipse.</p></li>
  <li><p>I clicked on project's name then clicked Export. I selected Runnable jar file and Copy required libraries into sub-folder next
  to generated jar file. I picked correct class from launch
  configuration. Then clicked finish.</p></li>
  </ul>
  
  <p>When i ran the jar file from cmd by typing <code>java -jar ssc.jar</code> It gives me this error:</p>
  
  <pre><code>exception in thread main java.lang.noclassdeffounderror
  </code></pre>
  
  <p>and some other lines with  tag.</p>
  
  <p>What should i do to fix this? </p>
  
  <p>Some documentations say that i need add classpath to program, or edit manifest file etc. I could not figure out how. </p>
  
  <p>I would appreciate your help. Thanks</p>
  
  <p>(Edit)SSC.java class under the demo package. It works when i run from the eclipse:</p>
  
  <pre><code>package demo;
  
  import java.io.BufferedReader;
  import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileReader;
  import java.io.FileWriter;
  import com.systemsunion.ssc.client.*;
  
  public class SSC {
  
      static String HOST="localhost";
      static int Port=8080;
  
      public static void main(String[] args) {
          try
          {
              SecurityProvider secman= new SecurityProvider(HOST,true);           
              String voucher= secman.Authenticate("PKP","").toString();
              String sInputPayload="";
              String path="C:/SSC temp/temp.txt";
              BufferedReader reader= new BufferedReader(new FileReader(path));
              BufferedWriter writer= new BufferedWriter(new FileWriter(new File("C:/SSC temp/temp-result.txt")));
              String line="";
              while((line = reader.readLine()) != null)
              {
                  sInputPayload = sInputPayload + line;
              }
              try
              {
                  SoapComponent ssc= new SoapComponent(HOST, Port);
                  ssc.authenticate(voucher);
                  String result= ssc.execute("Journal", "Import", sInputPayload);
                  writer.write(result);
                  writer.newLine();
                  writer.close();
              }
              catch(Exception ex)
              {
                  ex.printStackTrace();
              }
          }
          catch(Exception ex)
          {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>Error when i ran the jar file from cmd:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/systemsunion/ssc/
  
      client/SoapComponent
              at java.lang.Class.getDeclaredMethods0(Native Method)
              at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
              at java.lang.Class.getMethod0(Unknown Source)
              at java.lang.Class.getMethod(Unknown Source)
              at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
              at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: com.systemsunion.ssc.client.SoapCom
      ponent
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              ... 6 more
  </code></pre>