943,769 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1782
  • Java RSS
Dec 11th, 2008
0

how to add smack packge to API

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Narayan15 is offline Offline
20 posts
since Nov 2008
Dec 11th, 2008
0

Re: how to add smack packge to API

In your project you need to include classpath to this library from your IDE, for example in NetBeans you can do as described here
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,656 posts
since Dec 2004
Dec 11th, 2008
0

Re: how to add smack packge to API

actually i m using editplus editor, i dont use NetBeans
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Narayan15 is offline Offline
20 posts
since Nov 2008
Dec 11th, 2008
0

Re: how to add smack packge to API

please help me
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Narayan15 is offline Offline
20 posts
since Nov 2008
Dec 11th, 2008
0

Re: how to add smack packge to API

Then read the help file for that editor on how to include libraries on the classpath.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Dec 11th, 2008
0

Re: how to add smack packge to API

smack package? What's it do? Spank you?
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Dec 12th, 2008
0

Re: how to add smack packge to API

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.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: getting the output of a terminal as input into a java program.
Next Thread in Java Forum Timeline: Array dismay!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC