如何为 Eclipse 安装 XULRunner

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17994805/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:00:58  来源:igfitidea点击:

How to install XULRunner for Eclipse

javaeclipsexulrunner

提问by Nighty42

I'm using the SWT browser widgetto develop an application in Javawith Eclipse("Kepler").

我正在使用SWT 浏览器小部件通过Eclipse(“Kepler”)开发Java应用程序。

Now I want to use the Mozilla API and downloaded the latest sdkfrom XULRunner from this site: http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/latest/

现在我想使用 Mozilla API 并从这个站点从 XULRunner下载最新的sdkhttp: //ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/latest/

How can I tell Eclipse to use XULRunnerso I can use the following code line?

我如何告诉 Eclipse 使用XULRunner以便我可以使用以下代码行?

browser = new Browser(shell, SWT.MOZILLA);

Any suggestions on the same are highly appreciated.

任何关于相同的建议都受到高度赞赏。

采纳答案by atlanto

SWT is not supporting 'latest' XULRunner.
See Bug 327696 – [Browser] implement support for xulrunner >= 4.0

SWT 不支持“最新”的 XULRunner。
请参阅错误 327696 – [浏览器] 实现对 xulrunner >= 4.0 的支持

See also The SWT FAQ, Q: How do I specify the default type of native renderer that is used by the Browser?or Q: How do I explicitly use Mozilla as the Browser's underlying renderer?or so.

另请参阅 SWT 常见问题解答,问:如何指定浏览器使用的本机渲染器的默认类型?问:我如何明确使用 Mozilla 作为浏览器的底层渲染器?或者。

For example,

例如,

  1. Download the last one which is available on eclipse from http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0.4esr/sdk/
  2. Extract it to C:\
  3. Edit your app's Run Configuration->Arguments->VM Arguments, add following argument. -Dorg.eclipse.swt.browser.XULRunnerPath=C:\xulrunner
  1. http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0.4esr/sdk/下载 eclipse 上可用的最后一个
  2. 解压到 C:\
  3. 编辑您的应用程序的 Run Configuration->Arguments->VM Arguments,添加以下参数。-Dorg.eclipse.swt.browser.XULRunnerPath=C:\xulrunner

回答by Richard Gomes

I'm using Eclipse Kepler on Debian Wheezy.

我在 Debian Wheezy 上使用 Eclipse Kepler。

This is how I circunvented the trouble:

这就是我规避麻烦的方式:

  1. Make sure you don't have any package named xulrunner:

    $ dpkg --list | fgrep xulrunner

  2. Install xulrunner-10.0 ( DO NOT install xulrunner-17.0 )

    $ apt-get install xul-runner-10.0

  3. Insert the following line in your eclipse.ini file:

    -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-10.0

  4. Restart Eclipse. It should pick up the new configuration and should work as expected.

  1. 确保您没有任何名为 xulrunner 的包:

    $ dpkg --list | fgrep xulrunner

  2. 安装 xulrunner-10.0(不要安装 xulrunner-17.0)

    $ apt-get install xul-runner-10.0

  3. 在 eclipse.ini 文件中插入以下行:

    -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-10.0

  4. 重新启动 Eclipse。它应该采用新的配置并且应该按预期工作。