title: Export of runnable Java Class to .jar file including only required dependencies
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/475516/how-to-determine-which-classes-are-used-by-a-java-program">How to determine which classes are used by a Java program?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a Java project on Eclipse that contains a lot of Java classes. I want to export one of them to a .jar file but I ran into some problems.</p>
  
  <p>I already read through some existing threads, but I didn't get the right answer for my requirement, because:</p>
  
  <p>If I choose "Export to JAR file" I get the right class exported, but the .jar file does not contain the required dependencies to run the jar file.</p>
  
  <p>If I choose "Export to runnable JAR file" the resulting jar file contains all dependencies but also puts in all the other classes from the whole project (also those that I don't need).</p>
  
  <p>How can I export the single Java class to a .jar file that includes also required libraries for running the jar file? The resulting jar file has to be as small as possible.</p>
  
  <p>Thanks a lot.</p>