gcj-compiled HelloWorld.exe size

Boris Kolar boris.kolar@globera.com
Thu Jan 16 12:33:00 GMT 2003


> Consider that java.lang.String is vital to the runtime, and the example
I guess I could live without 90% of String's functions, so I can do a hack here.
I could also live without most Class's functions, especially "forName" and
reflection support.

> 100KB standalone executables, Java is probably the wrong language for you.
That's true, but I need to create two versions of essentially the same application:
1) Java-based for Windows-Linux-Anything users who have JRE already intalled.
2) ActiveX-based for those unlucky few WindowsXP users (and possibly a few other
users with badly outdated MS JREs).

The executables should be araound 100K maximum. If I use Java, about 90% of the
code would be shared, if not, almost everything would have to be written
seperately. I don't really need all that libgcj classes, just the same
*language* for both scenarios. I'm even considering using a language like
SmartEiffel, that can compile to both native and java bytecode.

Hmm, I just got another idea: how about if I compile libgcj native parts only
and let compiler build my project with my own versions of Object, Class, String,
... classes. Do you think that would work?

Boris


Jeff Sturm wrote:
> 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