SWT-Resouces

I put here some useful resources for compiling Java to windoofs exe.
Usage of own risk. ;) This should work with MinGW gcc 3.4.2/3.4.4

 
binary source comment
libswt-3138-3.1.bin.tar.gz swt-3.1-win32-win32-x86.zip,
swt-nl.jar,
changed files:
TableCursor.java
SWTMessages_de.properties
Lib compiled with MinGW gcc3.4.4 of eclipse based on v3.1
libiconv-1.9.2-2.bin.tar.gz libiconv-1.9.2-2-src.tar.bz2 Lib compiled with MinGW gcc3.4.4. I changed nothing I did this:
configure
make
make install
page by Dirk Höpfner 2005

How I created this?

To create the native SWT-lib I did following

  1. Fetch swt-3.1-win32-win32-x86.zip, swt-nl.jar from[http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-swt-home/main.html]
  2. Extract src.zip from swt-3.1-win32-win32-x86.zip to folder src and merge with swt-nl.jar but do not overwrite SWTMessages.properties
  3. Apply changes to TableCursor.java and bring your SWTMessages_XX.properties uptodate.
  4. Get impdef for creating libXXX.a from XXX.dll
  5. Then I used a fast created Makefile and type make -f Makfilelib.

How to use this?

Use a makefile similar to this

#
# File for building exe
#
SRC = ${wildcard *.java}                         # your java sources
OBJ = ${subst /,_,${patsubst %.java,%.o,${SRC}}} # object files

EXE = main.exe # name of executable
MAIN = Main    #  class with "public static void main(String argv[])"

.PHONY: all clean

all: ${EXE} ${OBJ}

clean:
	rm -rf ${OBJ} ${EXE}

${OBJ}:
	gcj -fjni --classpath="swt.jar;." -c ${subst _,/,${patsubst %.o,%.java,$@}} -o $@

${EXE}: ${OBJ}
	gcj -fjni --classpath="swt.jar" --main=${MAIN} -o ${EXE} ${OBJ} -L. -lswt-win32-3138 -lswt