大家好我试图运行以下代码,但遗憾的是遇到了错误问题 我想使用我的应用程序在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)