gcj for j2me?

Bryce McKinlay mckinlay@redhat.com
Tue Mar 8 16:00:00 GMT 2005


Michael wrote:
> How well does GCJ work for J2ME programs? Over on the mobile oss 
> development list (http://kavlon.org/index.php/mobile-oss) someone 
> asked and nobody seems to have much information. Anyone care to fill 
> us in? Thanks.

The compiler should be capable of supporting J2ME quite nicely, but 
currently libgcj is targeted more-or-less exclusively at J2SE. Due to 
the nature of J2SE, libgcj doesn't support static linking very well - if 
you want to make it this well and get your binaries down to a size thats 
realistic for a J2ME device, then you really need a stripped-down 
runtime that targets the J2ME profiles exclusively.
Two approaches have been proposed for this:
1. Add configury/hacks to libgcj that enable features you don't need to 
be disabled. Keep doing this until runtime is small enough.
2. Split the "core runtime" and "class library" components from libgcj 
into separate libraries, so that different class library profiles can be 
used. The core runtime would be modular and configurable enough that 
features not necessarily needed for J2ME (eg reflection, bytecode 
interpreter, networking, security, etc) can be disabled at configure time.
For various reasons I think #2 is a better approach in the long run, but 
maybe you'd want to try #1if you want to get something working ASAP.
Bryce


More information about the Java mailing list

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