This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executable size problem


Andrew Haley wrote:
Andrea aime writes:
> > I'm wondering, why every class of the standard runtime has to
> be compiled into the simple hello world style app?



I have done a few tests and managed to get the executable size down quite a bit.
Instead of linking all the libraries with all their contents, I used
ProGuard (a shrinker/obfuscator) to preprocess org.eclipse.* jars
in order to keep only the classes needed by the application, and then
compiled again with gcj. Surprise surprise, the executable is now "only"
18MB instead of 30MB, and it works, too: the linker did not shave off
many uneeded org.eclipse.* classes when I linked the original jars.
(if you want the proguard configuration file, I can send it to you).


I'm wondering if I can shrink it further by letting ProGuard process the
gjc runtime libraries... is it possible to get the runtime library as a
jar file and make the linker avoid linking libgcj.a? Just curious.

Best regards
Andrea Aime



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]