SWT-ResoucesI put here some useful resources for compiling Java to windoofs exe. |
||||||||||
|
||||||||||
| page by Dirk Höpfner 2005 | ||||||||||
To create the native SWT-lib I did following
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