java - Can "Export to JAR in Eclipse" be as smart as javac? -
java - Can "Export to JAR in Eclipse" be as smart as javac? - i want export part of java project jar file while including class files necessary run main class. project contains other main classes similar not identical dependencies. can run custom script accomplish it, this: mkdir temp cd temp javac -sourcepath "../" -d . ../mainclass_a.java jar cmf mainclass_a.manifest ../mainclass_a.jar * for elegance , more share others i'd run straight eclipse instead of custom script. however, when export jar file, or runnable jar file, every class file in project included. know can set manual filters exclude files, seems there should smarter option. how can configure eclipse include class files main class depends on? i think want impossible in general case. yes, theoretically javac can find (and finds) dependencies between classes. right if these dependencies hard coded within project, i.e. not utilize dynamic class loading , reflection either straig...