Thread: [Java-gnome-developer] Making native binaries
Brought to you by:
afcowie
From: Thomas P. <per...@ao...> - 2004-10-25 16:32:30
|
Hello, List! I'm currently developing a GUI for FunkyMD using java-gnome (the libgtk- java thing actually only). As I don't want to require ALL users who just want to run the program but are not motivated to download and install java-gnome, I want to compile my java code into a native linux binary. I've tried this with gcj, and it looks like it is working somehow. Can somebody come up with a step-by-step instruction on how to compile a java-gnome application "right" and how to deploy it then? (statically linked executable?, putting libs into the package? which libs?) Thanks for all information! Thomas Perl (PS: please cc to my email adress because I'm not in the list yet :) |
From: Mark H. <mh...@ti...> - 2004-10-25 18:55:03
|
If somebody writes this (which I really hope they do), please also add it to the website. On Mon, Oct 25, 2004 at 06:32:20PM +0200, Thomas Perl wrote: > Hello, List! > > I'm currently developing a GUI for FunkyMD using java-gnome (the libgtk- > java thing actually only). > > As I don't want to require ALL users who just want to run the program > but are not motivated to download and install java-gnome, I want to > compile my java code into a native linux binary. > > I've tried this with gcj, and it looks like it is working somehow. > > Can somebody come up with a step-by-step instruction on how to compile a > java-gnome application "right" and how to deploy it then? (statically > linked executable?, putting libs into the package? which libs?) > > Thanks for all information! > Thomas Perl > > (PS: please cc to my email adress because I'm not in the list yet :) > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > > -- .''`. Mark Howard : :' : `. `' http://www.tildemh.com `- mh...@de... | mh...@ti... |
From: Andrew C. <an...@op...> - 2004-10-25 21:48:53
|
On Mon, 2004-10-25 at 18:32 +0200, Thomas Perl wrote: > As I don't want to require ALL users who just want to run the program > but are not motivated to download and install java-gnome, I want to > compile my java code into a native linux binary. I think you're sort of confusing objectives here. 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. The other objective is to not have library dependencies. That's a bit strange, because with the exception of rescue systems and tiny embedded systems, virtually everything on a linux system is built with dependencies on shared libraries. What you actually said was "not to have to download and install java-gnome as a specific dependency" which is a bit different.=20 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. However, even assuming you statically compiled libgtk-java into your executable, you still have a very tight dependency on the underlying versions of the various GTK libraries (gtk, gdk, glib, etc). For example, if you built a statically linked java-gnome based application on your system, chances are that it won't run on my system because I probably (inevitably) have a different version of GTK than you. [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] > (statically > linked executable?, putting libs into the package? which libs?) 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. Otherwise, there's bound to be a disconnect somewhere.=20 Oh, and you'll probably need to recompile all the libraries you're statically linking in - I recall some sort of trouble if you try to statically link libraries which were built for dynamic/shared use. [If I'm wrong, I welcome someone else to correct me] 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. AfC Toronto --=20 Andrew Frederick Cowie OPERATIONAL DYNAMICS Operations Consultants and Infrastructure Engineers http://www.operationaldynamics.com/ |
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 |