How do I attach to Skype using Skype4Java?

馋奶兔 提交于 2019-12-23 17:52:35

问题


I am getting the following exception when trying to run the MakeCall example code:

com.skype.NotAttachedException
    at com.skype.Utils.convertToSkypeException(Utils.java:36)
    at com.skype.Skype.setDebug(Skype.java:116)
    at com.skype.sample.MakeCall.main(MakeCall.java:26)
Caused by: com.skype.connector.NotAttachedException
    at com.skype.connector.Connector.assureAttached(Connector.java:580)
    at com.skype.connector.Connector.addConnectorListener(Connector.java:604)
    at com.skype.connector.Connector.addConnectorListener(Connector.java:591)
    at com.skype.connector.Connector.setDebug(Connector.java:209)
    at com.skype.Skype.setDebug(Skype.java:114)
    ... 1 more

Now, I have not provided any sort of API credentials, so I kind of expect it to fail. My question then, is how do I provide whatever credentials necessary to attach my connector? The documentation on Skype4Java seems pretty slim.

After not getting any tips here, I have cross-posted this question on the Skype community forum as well.


回答1:


Had same thing, went on Skype->Options->Advance->Manage Other Programs access to Skype...selected Java.exe from the list and set option to allow. Working perfect now.




回答2:


If you have the dbus dependency installed, then make sure to start skype on the command line with the "--use-system-dbus".

https://developer.skype.com/Docs/ApiDoc/src#Linux

Once skype is running and you then start the java program, you'll be prompted to allow your java program to access skype.



来源:https://stackoverflow.com/questions/1203793/how-do-i-attach-to-skype-using-skype4java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!