Running a smack application from command line

Hi,

This might be a silly question but didn’'t see any thread with such a query.

I have created a simple smack application to create a user and send a message to an existing user…It was written in Eclipse and it compiles and runs fine on Eclipse…When i try to execute the file from command line it gives me an error saying “Exception in thread main java.lang.NoClassDefFoundError: org/jivesoftware/smack/XMPPConnection”

I have the smack.jar file in the same folder…Is there something I am not doing correctly?

Thanks,

Veena

Hi Veena,

you did add some classes to your classpath within Eclipse, didn’'t you?

You should do this also if you start your program as a standalone application.

LG

Hi LG,

I have added the classpath to the smack.jar …it compiled fine and created the class file …but now when I try to run it , it gives me Exception in thread main java.lang.NoClassDefFoundError: test

I am not sure whats goign wrong.

Thanks,

Veena

Hi Veena,

it seems that you did not add your class to the classpath. If you set a breakpoint and debug your application with the Ecplise debugger you can right-click on the running or pausing application and select properties. It will display the complete classpath, so you may see what’'s missing.

LG

i have put the org folder in my project folder and that seem to take care of the run time errors…thanks LG for youe help…Is there a class or function which allows me to start a chat with more than one person?

Thanks,

Veena

Hi Veena,

I didn’'t see one class, do you want to send a message to all users on a roster or how would you specify more than one person?

LG

provided within the smackx jar is the MUC class. This allows you to create or join Multi User Chat rooms allowing you to chat with many people at the same time.

http://www.jivesoftware.org/builds/smack/docs/latest/documentation/extensions/in dex.html

Will get you started

Message was edited by: JonWright

Message was edited by: JonWright