Binary size of statically linked java application

Marco Trudel mtrudel@gmx.ch
Thu Nov 30 10:26:00 GMT 2006


Lehner, Michael wrote:
> <snip>
>>>> I will leave all the ideas in my head, because I don't know in the
>>> moment how this all will end up and what way would be the best then.
>>> Writing stubs for the whole classpath will be a bit too time
> consuming.
>> Actually it can all be automated. I have most of it automated
> already...
>> [Lehner, Michael] 
> You have automated writing the stubs?

No, but that wouldn't be that a big deal. The rest is automated :-)
>>> But you said, that you had written stubs for awt,... Can you send
> they
>>> perhaps to me? This would save me some time to redo work you already
>>> did.
>> I attached the JARs for removing the GUI and for removing
> javax.crypto.
>> [Lehner, Michael] 
> noGui.jar is working fine for me, but noJce.jar throws me lots of errors
> like that: 
> .../libgcj.a(provider.o): (.data.rel+0x510): multiple definition of
> 'gnu::java::security::provider::DefaultPolicy::Gnu::class$'
> .../stubs.o: (.data.rel+0x4a4): first defined here

 From my FAQ:
Why do I get "multiple definitions of ..." errors when excluding the GUI 
or JCE?
That means that your code is using and thus pulling AWT/Swing or JCE 
into the binary. You have to either uncheck the "exclude GUI/JCE" box or 
change/delete your classes that need the libraries.
> Your noGui also seems as efficient as my way, I got down to 6,2MB and
> yours got me only to 6,6MB. But perhaps I threw out an additional Object
> File.

Yeah, right. Without JCE, it will be about 4.5mb. I only kick the 
objects containing classes with swing, awt, applet, print or imageio in 
the package name.
Marco
PS: Please always reply to all. There might be other people being 
interested in this thread.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /