linux audio software using gcj&swt!

Norbert Frese
Thu Oct 23 01:16:00 GMT 2003

> Static linking with Java is tricky. Certain resources may be missing 
> because they are only loaded dynamically (ie Class.forName), and the 
> linker can't see that to include them. One workaround is to add static 
> links to the missing classes in your code ie:
> static class foo =;

i have added the lines 

static Class foo =;
static Class foo2 =;

and the exceptions are gone. but there seems to be a problem with swt
now. the appliction starts up - then hangs (cpu 99%) for a while and
drops core (segmentation fault). (i think it hangs inside "new

is there anything wrong with my Makefile?
gcj -c --classpath=$(SWTLIBCLASSPATH) -fjni -o lib/swt_gcj.o \
gcj -c --classpath=$(SWTLIBCLASSPATH) -fjni -o lib/swt-pi_gcj.o \

find src | grep .java >filelist.gcj
gcj -g -c --classpath=$(SWTLIBCLASSPATH) @filelist.gcj -o bin/radiocap.o
gcj -static -s --main=app.radiocap.MainWindow lib/swt_gcj.o
lib/swt-pi_gcj.o bin/radiocap.o \
-o bin/radiocap_bin_static

i guess building a static binary (which includes libgcj) on linux is
really a tricky task. i've seen that other people gave up on this (read
the posts on this mailing list). :-(


More information about the Java mailing list