简体   繁体   English

如何为Eclipse安装XULRunner

[英]How to install XULRunner for Eclipse

I'm using the SWT browser widget to develop an application in Java with Eclipse ("Kepler"). 我正在使用SWT浏览器小部件Eclipse (“Kepler”)用Java开发应用程序。

Now I want to use the Mozilla API and downloaded the latest sdk from 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 XULRunner so I can use the following code line? 如何告诉Eclipse使用XULRunner以便我可以使用以下代码行?

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

Any suggestions on the same are highly appreciated. 对此相关的任何建议都非常感谢。

SWT is not supporting 'latest' XULRunner. SWT不支持'最新'XULRunner。
See Bug 327696 – [Browser] implement support for xulrunner >= 4.0 请参阅错误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? 另请参阅SWT常见问题解答, 问:如何指定浏览器使用的本机渲染器的默认类型? or Q: How do I explicitly use Mozilla as the Browser's underlying renderer? 问:我如何明确使用Mozilla作为浏览器的底层渲染器? or so. 或者。

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/ http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0.4esr/sdk/下载eclipse上提供的最后一个。
  2. Extract it to C:\\ 将其提取到C:\\
  3. Edit your app's Run Configuration->Arguments->VM Arguments, add following argument. 编辑应用程序的Run Configuration-> Arguments-> VM Arguments,添加以下参数。 -Dorg.eclipse.swt.browser.XULRunnerPath=C:\\xulrunner -Dorg.eclipse.swt.browser.XULRunnerPath = C:\\ xulrunner的

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: 确保您没有任何名为xulrunner的包:

    $ dpkg --list | $ dpkg --list | fgrep xulrunner fgrep xulrunner

  2. Install xulrunner-10.0 ( DO NOT install xulrunner-17.0 ) 安装xulrunner-10.0(不要安装xulrunner-17.0)

    $ apt-get install xul-runner-10.0 $ apt-get install xul-runner-10.0

  3. Insert the following line in your eclipse.ini file: 在eclipse.ini文件中插入以下行:

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

  4. Restart Eclipse. 重启Eclipse。 It should pick up the new configuration and should work as expected. 它应该选择新的配置并且应该按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM