problems compiling with libgcj

Warren Levy warrenl@redhat.com
Wed Jan 17 12:55:00 GMT 2001


On Wed, 17 Jan 2001, delmar watkins wrote:

> I am new to this list, sorry if this is a too-newbie
> querstion.  I am new to java (from the Perl side of
> things) but my company is now doing more 'embedded'
> devices, and Perl does not fit the bill.  Currently we
> are using C on the device, and Java for the client,
> and I would love to see Java being used on the device
> too.  However, I need to find a SMALL footprint java
> solution, and I thought that GCJ might be the
> solution.

First off, thanks for looking at GCJ and no, your question isn't
"too-newbie" ;-).  Hopefully, GCJ will be the solution you're looking for.

> And when I run it with 'java HttpMirror' it runs fine,
> but when I compile it with GCJ via:
> 
>       gcj --main=HttpMirror -o tester HttpMirror.class
> 
> I can hit the web server ONCE and then the second time
> I get:
> 
>       java.io.IOException: Bad file descriptor
>       Usage: java HttpMirror <port>

Hmm, I'm not able to reproduce this problem with a recent source tree 
built on x86 Linux.

> Again, it runs fine if compiled normally, but poops
> out the SECOND time when compiled with GCJ (version
> 2.95.3, debian package on a debian 2.2.17 kernel box).
> I don't understand why it is doing that.

If GCJ is reporting that it is version 2.95.3, I suspect that you've just
run into an old bug that's been fixed since then (and that's why I can't
reproduce it).

> Also, do I still have to have the libgcj on any box
> that I run a compiled program?  I noticed that libgcj
> is 1.5+ megs... which is too big for the embedded
> device (and what kind of embedded device can handle
> 1.5 megs??).  Someone, please educate me on this. 

You can compile statically (via -static) to avoid the use of shared libs.
Hope this helps!
--warrenl




More information about the Java mailing list