Re: [Java-gnome-developer] Compiling java-gnome applications with GCJ
Brought to you by:
afcowie
From: Alexey T. <a_t...@ma...> - 2007-04-22 08:44:46
|
> Hm. Actually, I don't think so. > > We really only use GCJ for debugging, but you don't need to compile an > application with -fjni if that app just _links_ against a [Java] library > (AOT compiled .so). > > Certainly when we build the java-gnome *library* (which is what actually > makes the JNI calls) _it_ we have to have -fjni on the gcj command line, > but to build any old program, we just do: > > $ gcj -lgtkjava-4.0 --main=CricketScores -o cricket CricketScores.java > $ ./cricket > > The command we use to build the Experiment class that ships in > tests/prototype/ is similar: > > $ make > $ gcj -g -Wl,-rpath=tmp/ -Ltmp -lgtkjava-4.0 -Djava.library.path=tmp/ > -classpath tmp/gtk-4.0.jar --main=Experiment -o experiment > tests/prototype/Experiment.java > $ ./experiment > > with all that extra noise just being what you have to do to deal with > linking against the still-in-place version of the compiled library, > rather than that which has been installed somewhere more sensible. > > AfC > Sydney > Yes! It works. LANG=C; gcj -lcairojava -lgladejava -lglibjava -lgnomejava -lgtkjava --main=test.Main app.jar --CLASSPATH=:/usr/share/java/gtk2.8.jar:/usr/share/java/gnome2.12.jar:/usr/share/java/glib0.2.jar:/usr/share/java/cairo1.0.jar -Djava.library.path=/usr/lib Thank you. |