Re: [javaCompiler-users] Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
Status: Beta
Brought to you by:
soapy
From: Marco T. <mt...@gm...> - 2006-08-20 17:08:25
|
Hello Stephen Stephen Longhust wrote: > Hi Marco, > > Thanks for the really quick reply, I appreciate all the good advice. > >> First of all, AWT and Swing is not ready for real applications. There >> are two possibilities for it right now: >> - swingWT; it maps AWT and Swing to SWT. A lot is still missing here >> until it's complete... But it's open source, you can enhance it to >> support all your needed stuff. > > This is a possibility. When I extracted the classes from my jar and > ran javaCompiler, I received some error messages at the compilation > stage relating to missing methods. One example was > BufferedImage.getRGB. It looks like the swingWT code doesn't yet > support all the things my graphics code uses. Yes, thats the problem. If you have the possibility to change to SWT directly or use an external library, I'd suggest to do so. I write all my GUI programs in SWT ;-) It is faster, looks better and can be natively compiled withhout any problems... > If I were to add the > necessary code to swingWT, would it be easy to then use this with > javaCompiler again? Would it just be a case of updating > swingwt-all.jar and swingwt-win.jar.o and swingwt-lin.jar.o? exactly... >> - AWT/Swing from gnu classpath (used by gcj). On linux it works only for >> shared applications, not for static. On windows it doesn't work at all. >> >> swingWT is currently the better choice... If you create a managed AWT or >> Swing project, this will be used. If you create a unmanaged project, the >> classpath AWT/Swing classes will be used (but because javaCompiler only >> creates static applications, this will fail anyway). > > So basically, using AWT/Swing from gnu classpath won't work at all > with javaCompiler at the moment, on Windows or Linux? On windows it doesn't work at all (or at least, no one tried so far). I was going to try that, but when I realized that it works only on shared exectuables on linux, I gave up completly. The first problem is, that there is no active windows maintainer for gcj. The second problem is, that the main gcj developpers are not really interested in static compilation of executables... regards Marco |