Thursday, August 21, 2008

Error preverifying class - java/lang/NoClassDefFoundError: java/lang/Object

Is an error you might see when preverifying your midlet. Basically the problem is that the verifier can not find the referenced classes - and if it complains about java.lang.Object it basically can not find anything.

We had this today, and the reason was that our tool (IntelliJ) generated a not so good ant file, with the classpath for the jre. That is not what the preverifier expects. Rather it should be something like:
-classpath C:\WTK2.5.2\lib\cldcapi11.jar;C:\WC:\WTK2.5.2\lib\midpapi21.jar


Tom Lee said...

thanks a lot Erik, i am using IDEA too and found the same error.

Emanuele said...

Many thanks Erik.
I'm had the same problem, although i'm using handwritten ant buildfile :)
(i've learnt ant just yesterday :-P)

Many thanks again :)

Hasyim said...

finally I understand what function of that code.. Thx Erik.. :D

robilen pontod said...

Must set preverify.classes.dir

then the error is

Error preverifying class org.jdesktop.beansbinding.BindingListener
java/lang/NoClassDefFoundError: java/util/EventListener

C:\Users\robi\Documents\NetBeansProjects\mobileApptry\nbproject\build-impl.xml:431: Preverification failed with error code 1.
BUILD FAILED (total time: 5 seconds)

please help :( badly needed.