Re: [Java-gnome-developer] Making native binaries
Brought to you by:
afcowie
From: Thomas P. <per...@ao...> - 2004-10-26 10:34:10
|
Am Montag, den 25.10.2004, 16:31 -0400 schrieb Andrew Cowie: > One objective is to make a native linux binary out of Java code. That's > what GCJ is good for, assuming your code works with the limited subset > of Java that the GNU team have managed to write. I'll guess it works if it runs? Anyway, is there a straightforward method of compiling a java-gnome application with gcj? I found this working somehow: gcj -- classpath=/usr/share/java/gtk2.4.jar:/usr/share/java/libgcj-3.3.4.jar - lgtkjava2.4 -lgtkjar2.4 --main=gFunkyMD gFunkyMD.java recordFiles.java - o gFunkyMD Is this the right way of doing it? The problem is that the gcj-compiled binary crashes when the class files with jvm don't crash - I could send the code of the faulty part if you want? Anyway, is there some way of doing the gcj compile thing "right" with java-gnome? Or is it okay as I do it above? > Anyone using a "modern" Linux distribution will find it has a packaging > system that is able to automatically fetch (and build, if necessary) all > the dependencies necessary. Since you raised the question, I assume you > are using a Linux distro without these capabilities, which makes your > request understandable, though I would suggest misguided. Fyi, I use Slackware. Although no dependency-checking in the packaging system, there are tools out there for it which do. I care about which packages are on my system, and want to keep that count as small as possible (in terms of "what I don't need I don't want on my disk"). Just being a "modern" distro doesn't automatically mean being a good distro. When I think of the SuSE machines at our school, they are as crappy as those Windows machines, in terms of "knowing what's going on inside". (No flame war intended.) I thought instead of insisting that users download that dependency, I could just accept the small overhead of the binary and .. nah, you're probably right that I'd have to do a package for java-gnome and give this away with my app ;) > [Indeed, that's the whole point of a dependency based packaging system - > that it takes care of expressing and resolving such things for you > *especially keeping track of dependencies between libraries*, which is > why I observed that this was likely a misguided effort as you're well on > your way to circumventing (and thus duplicating) all the work that the > distribution people do packaging libraries in the first place] I'll probably do a java-gnome package now, as I've said. > I'm certain it would work well for you if you statically linked in the > entire GTK library stack right down to libxml2, but that's on the order > of 60 packages. Would be a rather big binary. Just for the sake of trying out - how would I do this, command-wise? > Otherwise, there's bound to be a disconnect somewhere. I still wonder how these binary-only GTK apps work on my system without knowing what GTK version I'm using (RealPlayer 10 comes to my mind)? > ALL THIS SAID, the eclipse team obviously manage to ship binaries which > are linked against, among other things, a generic gtk API, so its > obviously do-able. I would suggest you look there for details. Can you please give more information on this? Do you mean I could develop GTK applications with eclipse with ease? Thanks for your time, Thomas |