Re: [Java-gnome-developer] Compiling java-gnome applications with GCJ
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2007-04-22 02:29:05
|
On Fri, 2007-04-20 at 15:48 -0500, Yaakov (Cygwin Ports) wrote:=20 > You need to add '-fjni' to your LDFLAGS 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=3DCricketScores -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=3Dtmp/ -Ltmp -lgtkjava-4.0 -Djava.library.path=3Dtmp/ -classpath tmp/gtk-4.0.jar --main=3DExperiment -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 |