This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compiling to native: simple q
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 11 Apr 2002 15:15:45 +1200
- Subject: Re: compiling to native: simple q
- References: <87zo0adzmh.fsf@pooh-sticks-bridge.tapsellferrier.co.uk>
Nic Ferrier wrote:
>I'm getting a whole bunch of errors that are to do with the
>dependancies of the class files.
>
>I have the CLASSPATH variable set to the jar files that are the
>dependancies for the paperclips classes, do I need to include them as
>compilation targets? (when I do that gcj segfaults).
>
>Should I be unpacking the jar files as classes and having gcj compile
>the whole thing?
>
>Should I be converting all the jar files into native libs and solving
>the depends that way?
>
Yes. You can't have native code that depends on bytecode (except for
weak dependencies, ie reflection)
You could compile the .jar files into shared libraries:
gcj -shared foo.jar -o libfoo.so
And then link your application against them:
gcj my/classes/*.java --main=my.classes.main -o myapp libfoo.so
regards
Bryce.