Re: [jnc-users] NullPointerExceptionatjava.net.URLClassLoader.getPermissions
Status: Beta
Brought to you by:
soapy
From: Marco T. <ma...@mt...> - 2009-12-03 09:31:39
|
Dear Keith Pleas read my previous mail again and do what I wrote there (extract libgcj.a (e.g. to "D:\only_libgcj_tmp") and add all objects to the compilation (flag "D:\only_libgcj_tmp\*")). This way - as already said - all libgcj objects will end up in your binary and you can test if it works. If it does, you can slowly remove the object you don't need (or the other way around). You seem to have made your live unnecessary complicated with the current problem :-( The solution to the xml problem already solved this... Ah yeah, if you're working on Linux, the "*" will not work in "D:\only_libgcj_tmp\*". So you might want to edit the JNC config file yourself and add all objects to it. Hope that helps Marco Keith Boynton wrote: > Hi Marco, > > That certainly does help, I'm a little further down the road and am > battling with the following error now. > > Exception in thread "main" java.lang.NoClassDefFoundError: > java.text.DecimalFormat > at gnu.xml.transform.Stylesheet.initDefaultDecimalFormat(win32.exe) > > I've asked a few questions on the java-gcc mailing list, they've been > very helpful and have suggested the following: > > #copy libgcj to a working dir (could be in a different location than > /usr/lib/ for you) > mkdir -p /tmp/mess_with_libgcj > cd /tmp/mess_with_libgcj > cp /usr/lib/libgcj.a . > > #extract all the object from this library > ar x libgcj.a > > #make a lib with only the properties objects > ar rvcs libgcj_properties.a *properties*.o > #do the (sometimes superfluous) blessing of the lib > ranlib libgcj_properties.a > > #copy the lib to the system lib dir > cp libgcj_properties.a /usr/lib/ > > #goto your source project and this time link-in those properties objects > with --whole-archive, this forces the linker to include them even if > they aren't statically referenced > cd <your source build-tree> > *gcj* -o <your prog> -Wl,--whole-archive -lgcj_properties > -Wl,--no-whole-archive -static-libgcj --main=<your main> > > > > Now, I've tried add the flags (-Wl,--whole-archive -lgcj_properties > -Wl,--no-whole-archive) to the Custom GCJ flags section. However I can't > seem to add them in the correct order. JNC seems to re-order them for me > and it ends up: > -Wl,--whole-archive -Wl,--no-whole-archive -lgcj_properties > > Is this a restriction or am I missing something? > > Keith |