java.lang.NoClassDefFoundError: java.text.DecimalFormat

Ben Gardiner BenGardiner@nanometrics.ca
Mon Nov 30 18:29:00 GMT 2009


Keith Boynton wrote:
> I have reached a problem I'm really struggling to resolve though.
>> I'm successfully compiling my project and have managed to resolve 
> quite a few "NoClassDefFoundError"s, by various methods.
>> However the fix for this one is really eluding me...
>> Exception in thread "main" java.lang.NoClassDefFoundError: 
> java.text.DecimalFormat
> at gnu.xml.transform.Stylesheet.initDefaultDecimalFormat
This sounds very similar to the problem addressed in a previous thread: 
http://old.nabble.com/SimpleDateFormat-td18000139.html. Perhaps the 
solution is also similar:
from that thread:
> #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> 
I hope this helps,
Ben


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /