This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: SwtImageViewer.java
Description: Binary data

Attachment: FileFormat.patch
Description: Binary data

Attachment: build-swt.sh
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]