【发布时间】:2017-07-19 11:38:36
【问题描述】:
我开始在 smack 和 eclipse 上使用 java 构建聊天客户端,所以我开始编写以下代码:
import org.jivesoftware.smack.XMPPConnection;
public class A {
// Create a connection to the igniterealtime.org XMPP server.
XMPPConnection connection = new XMPPConnection("myserver.com");
// Connect to the server
connection.connect();
// Most servers require you to login before performing other tasks.
connection.login("admin2", "123");
public static void main(String[] args) {
// TODO Auto-generated method stub
A a= new A();
}
}
但我收到以下两个错误:
Syntax error on token "connect", Identifier expected after this token
和
Syntax error on token ".", @ expected after this token
有人可以帮我吗?
【问题讨论】: