New SWT on Win32 build script, a tiny patch and an example - based on Rangit's stuff

John Murga john@murga.org
Fri Dec 13 16:58:00 GMT 2002


Hey

I've done some playing around with Ranjit's latest Win32 build and
things seem to be working very well, however there seems to be some
problems with "Class.forName()" not finding some SWT classes.

This prevents SWT from working with images, but I've enclosed a
patch (for SWT) that gets around this problem (the SWT code that
used Class.forName() didn't have to anyway).

Also, I found that compiling from source results in a library that
is 1.5Mb smaller (which has to be good), however, not everything can
be compiled from source so I've attached a script that takes care of
everything...

Using UPX my .exe ends up being less than 900k which is cool 8-)

If you want to give it a go just copy swt.war, swtsrc.zip and the files
in this post to a directory and do the following :

     build-swt.sh
     gcj -mwindows --classpath=./swt.jar --main=SwtImageViewer \
         SwtImageViewer.java -o imageView -L. -l-org-eclipse-swt
     strip imageView.exe
     
And if you have UPX (http://upx.sourceforge.net/) installed do :

     upx -9 imageView.exe

     871k ... Nice 8-)
     
I know a lot of people will know all this stuff but I hope it is useful
to someone out there...

Cheers
JohnM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SwtImageViewer.java
Type: application/octet-stream
Size: 4327 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20021213/f7b17809/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FileFormat.patch
Type: application/octet-stream
Size: 1559 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20021213/f7b17809/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build-swt.sh
Type: application/octet-stream
Size: 1601 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20021213/f7b17809/attachment-0002.obj>


More information about the Java mailing list