How to run Processing+Twitter4j sketch in broswer

泪湿孤枕 提交于 2019-12-02 06:46:57

Your comment is correct: your sketch won't work under JavaScript mode, because you're using a Java library. As long as you depend on a Java library, your code will only work in Java mode. You might want to check out the JavaScript console for error messages.

To solve the issue, you could try to look for an equivalent JavaScript library and use that instead of twitter4j. Then your code would work in JavaScript mode. That's probably the correct thing to do.

The reason I say that is it's a huge pain to get Java applications to run in the browser. You'd have to create an applet, and then either sign the jar with a paid certificate, or have your users modify their Java security settings- and even then, your users will get a bunch of security warnings and prompts before they run your applet.

You're better off either deploying as a runnable jar or platform-specific executable, or switching entirely to JavaScript mode by finding an equivalent JavaScript library.

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