使用Jskype向Skype发送消息

时间:2013-10-04 11:27:26

标签: java sendmessage

大家好我试图运行以下代码,但遗憾的是遇到了错误问题 我想使用我的应用程序在Skype中发送群组消息。

import net.lamot.java.jskype.general.AbstractMessenger;
import net.lamot.java.jskype.general.MessageListenerInterface;
import net.lamot.java.jskype.windows.Messenger;

import java.lang.Thread;
import java.lang.Exception;
import java.util.Date;


public class JSkype implements MessageListenerInterface {

    private AbstractMessenger msgr = null;

   public JSkype() {

   msgr = new Messenger();
   msgr.addListener(this);

   msgr.initialize();
   try {
     Thread.sleep(5000);

     try {

         msgr.sendMessage("MESSAGE nirajthakar hiiiii");
    } catch (Exception e) {
        // TODO: handle exception
    }
     System.out.println("done");

   } catch (Exception e) {
     e.printStackTrace();
   }
   }

   public static void main(String[] args) {
     new JSkype();
   }

   public void onMessageReceived(String str) {

     System.out.println("RESULT: "+str);
      }
}

我得到了这个错误。我添加了jar filein应用程序。

java.lang.UnsatisfiedLinkError: no JSkype in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1878)
    at java.lang.Runtime.loadLibrary0(Runtime.java:849)
    at java.lang.System.loadLibrary(System.java:1087)
    at net.lamot.java.jskype.windows.Messenger.initialize(Messenger.java:45)
    at JSkype.<init>(JSkype.java:19)
    at JSkype.main(JSkype.java:37)
Messenger.initialize()
Messenger.sendMessage()
Exception in thread "main" java.lang.UnsatisfiedLinkError: net.lamot.java.jskype.windows.Messenger.nativeSendMessage(Ljava/lang/String;)I
    at net.lamot.java.jskype.windows.Messenger.nativeSendMessage(Native Method)
    at net.lamot.java.jskype.windows.Messenger.sendMessage(Messenger.java:59)
    at JSkype.<init>(JSkype.java:25)
    at JSkype.main(JSkype.java:37)

1 个答案:

答案 0 :(得分:0)

您可以查看此链接以获取解决方案 java. Skype - send message

由于 krunal