MemLeak
MemLeak

Reputation: 4640

Eclipse export runnable jar - exclude javadoc and sources

I'm exporting my swing application as a runnable jar file. So far so good. I noticed that in every export all the unit-tests, sources and javadoc for each library are included. which means a big overhead for the application. How can I define only to export the used class files, and only the core-libraries without javadoc?

This application run not with maven.

thanks

//edit, some pictures: As example guava, who is saved in 3 jars ( code, sources, javadoc) in my lib folder.

lib folder

My build path settings where i define the sources and javadoc buildpath settings

and the with 7-zip opened jar, where sources and javadocs are included, but shouldn't be. jar

Upvotes: 2

Views: 2958

Answers (2)

apptaro
apptaro

Reputation: 289

If you want to use Eclipse export to create a runnable jar, but you want to control which files to include and which files to exclude, follow the following steps:

  1. File > Export > Runnable JAR file > Next
  2. Configure export options
  3. Check the "Save as ANT script" option > Finish
  4. Edit the ANT script to include/exclude files
  5. Right click on the ANT script > Run As > Ant Build

That's it!

Upvotes: 1

Sam Su
Sam Su

Reputation: 6832

Right-click on the project,choose Properties > Java Build path > Order and Export,or you can pick what you want to export from the export wizard.

//EDIT:
Choose a lighter jar,e.g,you can download Guava from http://search.maven.org/remotecontent?filepath=com/google/guava/guava/14.0.1/guava-14.0.1.jar instead of your jar which contains source and doc file.That's the reason that makes your project so large.

Upvotes: 2

Related Questions