问题描述
- XMPP客户端Smack4.0.6 jar包,不能再jdk1.6中编译通过求大神解答?
-
利用XMPP协议进行客户端开发,使用Smack4.0.6 api jar包,在demo中无法编译通过
出现如下错误
java.lang.UnsupportedClassVersionError: org/jivesoftware/smack/SmackException : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Exception in thread "main"附上类主要方法:
public static void main(String[] args){
System.out.println("start......");
// User user=new User();
// user.setUsername("wsm");
// user.setPassword("123456");
// RegistServiceImpl r=new RegistServiceImpl();
// r.regist(user);} public void regist(User user) { // TODO Auto-generated method stub ConnectionConfiguration connConfig=new ConnectionConfiguration(SERVER_IP, SERVER_PORT);//创建一个连接配置 XMPPConnection connection = new XMPPTCPConnection(connConfig);//与服务器建立一个TCP连接 try { connection.connect(); AccountManager.getInstance(connection).createAccount(user.getUsername(), user.getPassword());//进行注册 } catch (SmackException e) { //TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (XMPPException e) { // TODO Auto-generated catch block e.printStackTrace(); }//连接 }
另外:我的win7系统使用jdk是1.6,项目中使用的jdk也是1.6的
求大神解答!!!!!
时间: 2024-11-01 13:44:51