powered by Jive Software

XMPPConnection NoClassDefFound

import org.jivesoftware.smack.*;

public class message


public static void main(String[] args)




XMPPConnection conn = new XMPPConnection(“”);

conn.login(“admin”, “123456”);

Chat chat = conn.createChat("Josh@");

chat.sendMessage(“This is a Test”);


catch (Exception e)







ok thats my simple program to send a message to me from command prompt.

I compiled it using:

javac -classpath \smack.jar

It compiles with no errors.

I then run it using:

java message

I get the following error:

Execption in thread “main” java.lang.NoClassDefFoundError: org/jivesoftware/smack/XMPPConnection

Thanks in advance.

Edit: I complete changed the post to reflect my further attempt at getting it to work.

Got it working. For anyone thats curious The solution was to include all the classpath definitions when calling my script from command prompt.

So instead of:

java message

I did:

java -classpath “<class1>;\smack.jar;\smackx.jar” message

Works like a champ