Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Compilation bloat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Compilation bloat" Watch "Compilation bloat" New topic
Author

Compilation bloat

b huang
Greenhorn

Joined: Feb 01, 2011
Posts: 1
I have a small Applet project that imports three java files from a large open source library with few hundred classes, which I link to the complete source and compile in my Eclipse project.

My problem is, instead of just the few classes I use, this entire library is compiled and stuffed along with my Applet .class into a large .jar file.

I suppose I can manually determine the subset of classes from the large library that my applet uses, and link these external sources only in my project.

But that is very cumbersome. Is there a better way?

The way I am doing things in Eclipse, I link to complete external library as source, and create the .jar using the export feature.

Also interested in knowing if the scenario I encounter is standard in Java or Eclipse?

Thanks
Arek Sokolowski
Greenhorn

Joined: Jan 12, 2011
Posts: 8

Yes, this is 'standard case in java'.
I'll skip details, I'm sure you will explore it some day, if you will make more java.

If you are sure which classes are required by your project, and if these classes are not using any other classes from mentioned jar file - you can copy them to your project, change the package (or not) and use them.
Of course only if the used library licence allows you to do that!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Compilation bloat
 
Similar Threads
Ill-advised or mistaken usage of a core class
eclipse ganymede - how to redirect non ejb library jars to lib
Multiple projects in SVN but single project in local Eclipse IDE.
ant conf file - where to add external libs
IntelliJ IDEA Debugging Question