我正在使用 SWT 浏览器小部件在 Java 和 Eclipse(“Kepler”)中开发应用程序。
现在我想使用 Mozilla API 并从该站点的 XULRunner 下载最新的 sdk:http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/latest/
如何告诉 Eclipse 使用 XULRunner 以便我可以使用以下代码行?
browser = new Browser(shell, SWT.MOZILLA);
如有任何建议,我们将不胜感激。
最佳答案
SWT 不支持“最新的”XULRunner。
参见 Bug 327696 – [Browser] implement support for xulrunner >= 4.0
另请参阅 SWT 常见问题解答,Q: How do I specify the default type of native renderer that is used by the Browser?或 Q: How do I explicitly use Mozilla as the Browser's underlying renderer?左右。
例如,
- 从 eclipse 下载最后一个可用的 http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0.4esr/sdk/
- 解压到C:\
- 编辑您应用的运行配置->参数->VM 参数,添加以下参数。 -Dorg.eclipse.swt.browser.XULRunnerPath=C:\xulrunner
关于java - 如何为 Eclipse 安装 XULRunner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17994805/