Possible Duplicate:
How to determine which classes are used by a Java program?
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.
I already read through some existing threads, but I didn't get the right answer for my requirement, because:
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.
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).
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.
Thanks a lot.