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]

Re: linux audio software using gcj&swt!


> 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 = gnu.java.localeCalendar.class;
> 

i have added the lines 

static Class foo = gnu.java.locale.Calendar.class;
static Class foo2 = gnu.java.locale.LocaleInformation.class;

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
Display()")

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

app-static:
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). :-(

thanks
norbert





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