building gcj on OS X (also AWT)

Bryce McKinlay bryce@waitaki.otago.ac.nz
Mon May 24 17:19:00 GMT 2004


On May 24, 2004, at 8:23 AM, Michael Purdy wrote:

> John, et. al.
>
> This is a great thread!
>
> How do we go about using gcj to compile whole existing .jar files?

gcj somejar.jar --main=some.class.in.Jar -o myapp

or perhaps:

gcj -shared somejar.jar -o libsomejar.so

> Also, does anyone know of a resource which further explains the linking
> process and how to link many files at once.

Use "-l" to link a binary that has some dependency on a shared library. 
For example, if you already have the libsomejar.so above:

gcj Main.java --main=Main -o myapp -lsomejar

To run it:

export LD_LIBRARY_PATH=.
./myapp

It would be cool if this kind of thing were documented in the gcj 
manual. Patches welcome, as always.

Regards

Bryce



More information about the Java mailing list