powered by Jive Software

java.lang.NoClassDefFoundError

i was using the jar files of smack in building my application (in netbeans 5.0) and it ran perfectly fine. but whenever i use the resulting jar file and run it in the console on a different pc (using java -jar FileName.jar), it gave the error

java.lang.NoClassDefFoundError: org/jivesoftware/smack.XMPPException

this is why i hate IDE’'s like netbeans.

any help would be appreciated. thanks!

Hey Ariel,

Building smack jar files from an IDE should work just fine. You can use the ant jar target to build smack. Make sure that you are adding smack.jar and smackx.jar to the classpath of your application. Another verification you can do is open the jar files with winzip or winrar and verify that the smack classes are present in the file.

Regards,

– Gato

i’‘ve tried adding the smack.jar and smackx.jar files in the library using netbeans (i forgot to mention that i’'m using netbeans). it worked fine, although whenever i use the resulting jar file of the project (after building) and transfer it to another pc and run it from there (using java -jar <filename.jar>), it throws that kind of error.