gcj-compiled HelloWorld.exe size

Jeff Sturm jsturm@one-point.com
Thu Jan 16 05:17:00 GMT 2003


On Thu, 16 Jan 2003, Boris Kolar wrote:
> Many people don't need most libgcj classes anyway, so why should every
> executable contain them? I'd like to have a stripped-down version of libgcj,
> which would contain only the most basic classes (Object, Class, maybe String).

Consider that java.lang.String is vital to the runtime, and the example
you've tried directly initializes java.lang.System, java.io.PrintStream,
and indirectly needs Properties, Runtime, OutputStream, and a whole host
of other classes.  You may be able to trim down the size somewhat, but
it'll never be as small as those three classes you mention.

How small do you require?  I suspect that with some careful hacking a 2x
reduction of HelloWorld.exe could be achievable.  However if you need
100KB standalone executables, Java is probably the wrong language for you.

Jeff



More information about the Java mailing list