| | |
how to add smack packge to API
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 20
Reputation:
Solved Threads: 0
i have installed Jdk6.0 version, this doesn't contain smack package.
here i have written a programme
import java.util.Collection;
import org.jivesoftware.smack.*;
public class GtalkClient {
public static void main(String[] args) throws XMPPException {
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
connection.login("< narayana.nuz >","< narayanramlall >");
// Below is the code to get the users
// Here is a code to send message to a friend
MessageListener messageListener = null;
Chat chat = connection.getChatManager().createChat("sridhar.nuz@rgukt.in",messageListener);
chat.sendMessage("ore");
}
}
I m getting this error
---------- compile ----------
GtalkClient.java:3: package org.jivesoftware.smack does not exist
import org.jivesoftware.smack.*;
^
GtalkClient.java:7: cannot find symbol
symbol : class XMPPException
location: class GtalkClient
public static void main(String[] args) throws XMPPException {
^
GtalkClient.java:8: cannot find symbol
symbol : class ConnectionConfiguration
location: class GtalkClient
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
^
GtalkClient.java:8: cannot find symbol
symbol : class ConnectionConfiguration
location: class GtalkClient
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
^
GtalkClient.java:9: cannot find symbol
symbol : class XMPPConnection
location: class GtalkClient
XMPPConnection connection = new XMPPConnection(config);
^
GtalkClient.java:9: cannot find symbol
symbol : class XMPPConnection
location: class GtalkClient
XMPPConnection connection = new XMPPConnection(config);
^
GtalkClient.java:19: cannot find symbol
symbol : class MessageListener
location: class GtalkClient
MessageListener messageListener = null;
^
GtalkClient.java:20: cannot find symbol
symbol : class Chat
location: class GtalkClient
Chat chat = connection.getChatManager().createChat("sridhar.nuz@rgukt.in",messageListener);
^
8 errors
Output completed (0 sec consumed) - Normal Termination
could u please help me
here i have written a programme
import java.util.Collection;
import org.jivesoftware.smack.*;
public class GtalkClient {
public static void main(String[] args) throws XMPPException {
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
XMPPConnection connection = new XMPPConnection(config);
connection.connect();
connection.login("< narayana.nuz >","< narayanramlall >");
// Below is the code to get the users
// Here is a code to send message to a friend
MessageListener messageListener = null;
Chat chat = connection.getChatManager().createChat("sridhar.nuz@rgukt.in",messageListener);
chat.sendMessage("ore");
}
}
I m getting this error
---------- compile ----------
GtalkClient.java:3: package org.jivesoftware.smack does not exist
import org.jivesoftware.smack.*;
^
GtalkClient.java:7: cannot find symbol
symbol : class XMPPException
location: class GtalkClient
public static void main(String[] args) throws XMPPException {
^
GtalkClient.java:8: cannot find symbol
symbol : class ConnectionConfiguration
location: class GtalkClient
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
^
GtalkClient.java:8: cannot find symbol
symbol : class ConnectionConfiguration
location: class GtalkClient
ConnectionConfiguration config = new ConnectionConfiguration("talk.google.com", 5222, "rgukt.in");
^
GtalkClient.java:9: cannot find symbol
symbol : class XMPPConnection
location: class GtalkClient
XMPPConnection connection = new XMPPConnection(config);
^
GtalkClient.java:9: cannot find symbol
symbol : class XMPPConnection
location: class GtalkClient
XMPPConnection connection = new XMPPConnection(config);
^
GtalkClient.java:19: cannot find symbol
symbol : class MessageListener
location: class GtalkClient
MessageListener messageListener = null;
^
GtalkClient.java:20: cannot find symbol
symbol : class Chat
location: class GtalkClient
Chat chat = connection.getChatManager().createChat("sridhar.nuz@rgukt.in",messageListener);
^
8 errors
Output completed (0 sec consumed) - Normal Termination
could u please help me
In your project you need to include classpath to this library from your IDE, for example in NetBeans you can do as described here
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
smack package? What's it do? Spank you?
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Use Apache Ant as a build tool to compile your application with dependencies or just use the command line invocation of `javac' and `java' which supports classpath options.
The romantic image of an über-programmer is someone who fires up Emacs, types like a machine gun, and delivers a flawless final product from scratch. A more accurate image would be someone who stares quietly into space for a few minutes and then says “Hmm. I think I’ve seen something like this before.” - John D
![]() |
Other Threads in the Java Forum
- Previous Thread: getting the output of a terminal as input into a java program.
- Next Thread: Array dismay!
Views: 941 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for Java
911 addressbook android api append apple applet application arguments array arrays automation binary bluetooth character chat class classes client code component csv database detection draw eclipse error event exception file fractal ftp game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me japplet java javaarraylist javaprojects jmf jni jpanel julia linux list loop map method methods mobile netbeans newbie number object objects oracle oriented os panel print problem program programming project projects recursion replaydirector reporting researchinmotion return robot scanner score screen se server set size sms socket sort sql stream string swing test threads time transfer tree ubuntu windows






