Linux SWT 浏览器和 Eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9695271/
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
SWT Browser & Eclipse
提问by Jiew Meng
On my Arch Linux, Eclipse with Google Window Builder/SWT application, I am getting
在我的 Arch Linux、Eclipse 和 Google Window Builder/SWT 应用程序上,我得到
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
at org.eclipse.swt.SWT.error(SWT.java:4308)
at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1826)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:687)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:99)
at octopus.EventSummaryComposite.<init>(EventSummaryComposite.java:33)
at octopus.EventEditingComposite.<init>(EventEditingComposite.java:45)
at octopus.EventManagementController.<init>(EventManagementController.java:31)
at octopus.MainController.<init>(MainController.java:38)
at octopus.MainController.main(MainController.java:85)
I believe I need to install XULrunner or something. But when I install xulrunner
in Arch, I get xulrunner and eclipse are in conflict
. So I tried installing pywebkitgtk
. Then I added -Dorg.eclipse.swt.browser.DefaultType=webkit
to /usr/bin/eclipse
and /usr/share/eclipse/eclipse.ini
not sure which is used. But when I run, I still get the same error. It appears webkit is still not used. How can I fix this?
我相信我需要安装 XULrunner 或其他东西。但是当我xulrunner
在 Arch 中安装时,我得到xulrunner and eclipse are in conflict
. 所以我尝试安装pywebkitgtk
. 然后我添加-Dorg.eclipse.swt.browser.DefaultType=webkit
到/usr/bin/eclipse
并且/usr/share/eclipse/eclipse.ini
不确定使用哪个。但是当我运行时,我仍然得到同样的错误。看来还没有使用 webkit。我怎样才能解决这个问题?
UPDATE 2
更新 2
So far I tried installing libwebkit3
. Then added -Dorg.eclipse.swt.browser.UseWebKitGTK=true
to /usr/share/eclipse/eclipse.ini
, I get the same error.
到目前为止,我尝试安装libwebkit3
. 然后添加-Dorg.eclipse.swt.browser.UseWebKitGTK=true
到/usr/share/eclipse/eclipse.ini
,我得到同样的错误。
Then I also tried downloading and extracting xulrunner
from mozillato ~/xulrunner
and adding -Dorg.eclipse.swt.browser.XULRunnerPath=/home/jiewmeng/xulrunner/
to config, still same error...
然后我也尝试下载并解压缩xulrunner
从Mozilla浏览器,以~/xulrunner
和添加-Dorg.eclipse.swt.browser.XULRunnerPath=/home/jiewmeng/xulrunner/
到配置,还是同样的错误......
In Ubuntu just now, I just installed xulrunner
and it worked... I wonder if the config is even used?
刚刚在 Ubuntu 中,我刚刚安装xulrunner
并运行了......我想知道是否甚至使用了配置?
UPDATE (Environment & Versions)
更新(环境和版本)
- Arch Linux
- GNOME 3
- Eclipse 3.7.2
- SWT 1.3.0/3.7.2 (http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7)
- XULRunner 1.9.2.19 (http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2.19/)
- Firefox 11 (from pacman)
- 拱形Linux
- 侏儒 3
- 日食 3.7.2
- SWT 1.3.0/3.7.2 (http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7)
- XULRunner 1.9.2.19 (http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.2.19/)
- Firefox 11(来自吃豆人)
Let me know if you need other relavent info
如果您需要其他相关信息,请告诉我
UPDATE (Old)
更新(旧)
If I change my code to
如果我将代码更改为
new Browser(this, SWT.WEBKIT)
I get
我得到
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4308)
at org.eclipse.swt.SWT.error(SWT.java:4197)
at org.eclipse.swt.SWT.error(SWT.java:4168)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:103)
at octopus.EventSummaryComposite.<init>(EventSummaryComposite.java:33)
at octopus.EventEditingComposite.<init>(EventEditingComposite.java:45)
at octopus.EventManagementController.<init>(EventManagementController.java:31)
at octopus.MainController.<init>(MainController.java:38)
at octopus.MainController.main(MainController.java:85)
采纳答案by MrGomez
The apparent problem, in accordance with the edited question and all of the errata, appears to be a version conflict between your running version of Eclipse and the versions of both Mozilla or WebKit installed on your system. This is further conflated by extremely terse documentationand dependency hell.
根据已编辑的问题和所有勘误表,明显的问题似乎是您运行的 Eclipse 版本与系统上安装的 Mozilla 或 WebKit 版本之间存在版本冲突。极其简洁的文档和依赖地狱进一步混淆了这一点。
The key is to check your running Eclipse version and compare it to the versions of xulrunner
and libwebkit
installed on your system, exactly as recommended in the answer and errata hereand documented in the FAQ here. However, based on the difficulties you've had and the sparse documentation on this problem, you'll want to take special precautions to ensure that all of your dependencies are satisfied for the strictly correct versions.
关键是要检查你运行Eclipse版本,比较它的版本xulrunner
和libwebkit
完全一样的答案,勘误建议安装在系统上,这里和常见问题记录在这里。但是,基于您遇到的困难以及关于此问题的稀疏文档,您需要采取特殊的预防措施以确保您的所有依赖项都满足严格正确的版本。
Given your diagnosis that xulrunner and eclipse are in conflict
, I did some digging to find the correct resolution to this problem. It turns out this is covered in extensive detail in this thread. The salient information you need to be concerned about:
鉴于您的诊断xulrunner and eclipse are in conflict
,我做了一些挖掘以找到解决此问题的正确方法。事实证明,此线程中对此进行了广泛详细的介绍。您需要关注的重要信息:
Eclipse 3.5.2-3.6.x are incompatible with xulrunner 2.0. If this is an older system, use xulrunner 1.9.2-15-2 to solve the problem.
The version of Eclipse you are using very likely does not support
libwebkit3
. As mentioned, it is exceedingly likely that you will need to use an earlier version.In all cases, building a version of Firefox with the correct Gecko bindings should resolve the issue and, as point of fact, reproduces this bug when those bindings are not present:
Eclipse 3.5.2-3.6.x 与 xulrunner 2.0 不兼容。如果这是一个较旧的系统,请使用 xulrunner 1.9.2-15-2 来解决问题。
您使用的 Eclipse 版本很可能不支持
libwebkit3
. 如前所述,您极有可能需要使用较早的版本。在所有情况下,构建具有正确 Gecko 绑定的 Firefox 版本应该可以解决问题,并且事实上,当这些绑定不存在时,会重现此错误:
Also note that a Firefox release whose contained Gecko version correlates with the Mozilla versions above can also be used with Eclipse 3.1 and newer (Linux only), provided that it has been compiled with linkable Gecko libraries. It is important to note that Firefox downloads from mozilla.org do not satisfy this criteria, but Firefox installations that are included in major Linux distributions often do in the absence of a XULRunner installation. Attempting to use a Firefox install without linkable Gecko libraries will throw an error with message "No more handles [NS_InitEmbedding...error -2147221164]".
另请注意,包含 Gecko 版本与上述 Mozilla 版本相关的 Firefox 版本也可用于 Eclipse 3.1 和更新版本(仅限 Linux),前提是它已使用可链接的 Gecko 库进行编译。需要注意的是,从 mozilla.org 下载的 Firefox 不满足此标准,但主要 Linux 发行版中包含的 Firefox 安装通常在没有 XULRunner 安装的情况下满足。尝试在没有可链接 Gecko 库的情况下使用 Firefox 安装会抛出错误消息“没有更多句柄 [NS_InitEmbedding...error -2147221164]”。
In short: the problem is with Arch Linux's packaging of the dependencies for Eclipse SWT. But, this is a year-old issue that indicates your Eclipse version and the rest of your system is in desperate need of a software upgrade... :)
简而言之:问题在于 Arch Linux 对 Eclipse SWT 依赖项的打包。但是,这是一个存在一年的问题,表明您的 Eclipse 版本和系统的其余部分急需软件升级... :)
Edit:To get Google WindowBuilder Pro's copy of SWT's browser widgets working in Arch Linux, I created a VM and stepped through this process with the OP. I was able to reproduce the bug in both the 32- and 64-bit versions of Arch Linux.
编辑:为了让Google WindowBuilder Pro的 SWT 浏览器小部件副本在 Arch Linux 中工作,我创建了一个 VM,并使用 OP 逐步完成了这个过程。我能够在 32 位和 64 位版本的 Arch Linux 中重现该错误。
It turns out Arch Linux's bindings for libwebkit
were insufficient, so I went ahead and built xulrunner-1.9.2.19
from source. After a wholelotof necessaryfixups, my make install
version just works with Eclipse.
事实证明 Arch Linux 的绑定libwebkit
不足,所以我继续xulrunner-1.9.2.19
从源代码构建。经过一整个很多的必要的修正,我的make install
版本只是工作与Eclipse。
The next step, for anyone willing, is to report this to Arch Linux.
对于任何愿意的人来说,下一步是向 Arch Linux 报告此事。
回答by Kane
See browser QA in SWT FAQ
请参阅SWT 常见问题中的浏览器 QA
回答by sunil kumar
MOZILLA_FIVE_HOME not set for eclipse pluging or any pluging gives unhandled error please do the follwoing process and you are done.
MOZILLA_FIVE_HOME 未设置为 Eclipse 插件或任何插件都出现未处理的错误,请执行以下过程,您就完成了。
You may get a "MOZILLA_FIVE_HOME not set" error after you install eclipse color theme plugin in ubuntu 12.04. Here's a workround.
在 ubuntu 12.04 中安装 eclipse 颜色主题插件后,您可能会收到“MOZILLA_FIVE_HOME 未设置”错误。这是一个解决方法。
Download and Install libhunspell-1.2-0from here and install it.
sudo dpkg -i libhunspell-1.2-0_1.2.14-4_amd64.deb
Download and install xulrunner-1.9.2from here and install it.
sudo dpkg -i xulrunner-1.9.2_1.9.2.28+build1+nobinonly-0ubuntu0.11.04.1_amd64.deb
从这里下载并安装libhunspell-1.2-0并安装它。
sudo dpkg -i libhunspell-1.2-0_1.2.14-4_amd64.deb
从这里下载并安装xulrunner-1.9.2并安装它。
须藤 dpkg -i xulrunner-1.9.2_1.9.2.28+build1+nobinonly-0ubuntu0.11.04.1_amd64.deb
回答by cfillol
This steps worked for me with STS 2.9.2 based on Eclipse 3.7.2 (Ubuntu 12.04 - 64bits):
这些步骤适用于基于 Eclipse 3.7.2(Ubuntu 12.04 - 64 位)的 STS 2.9.2:
- Install Google plugin for Eclipse using this update site: http://dl.google.com/eclipse/plugin/3.7. I just wanted to use GWT, so I only checked "Google plugin for Eclipse", "GWT Designer for GPE" and "SDKs".
- Restart Eclipse and verify that trying to design a GWT UIBinder view with WindowBuilder fails showing an error related to xulrunner.
- Close Eclipse.
- Install required packages (inspired by http://elgali.net/2012/05/14/gwt-designer-eclipse-plugin-in-ubuntu-12-04/)
- sudo apt-get install libicu48
- sudo apt-get install libwebkitgtk-1.0-common
- sudo apt-get install libwebkitgtk-1.0-0
- Start Eclipse again and check that WindowBuilder Desing view works!
- 使用此更新站点为 Eclipse 安装 Google 插件:http: //dl.google.com/eclipse/plugin/3.7。我只是想使用 GWT,所以我只检查了“Eclipse 的 Google 插件”、“GPE 的 GWT 设计器”和“SDK”。
- 重新启动 Eclipse 并验证尝试使用 WindowBuilder 设计 GWT UIBinder 视图失败并显示与 xulrunner 相关的错误。
- 关闭日食。
- 安装所需的包(灵感来自http://elgali.net/2012/05/14/gwt-designer-eclipse-plugin-in-ubuntu-12-04/)
- 须藤 apt-get 安装 libicu48
- 须藤 apt-get 安装 libwebkitgtk-1.0-common
- 须藤 apt-get 安装 libwebkitgtk-1.0-0
- 再次启动 Eclipse 并检查 WindowBuilder Desing 视图是否有效!
回答by f-3r
回答by Campa
In my case I just had to install libwebkitgtk-1.0-0:
就我而言,我只需要安装libwebkitgtk-1.0-0:
sudo apt-get install libwebkitgtk-1.0-0
Info on my machine:
我的机器上的信息:
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
See also: https://rusya7.blogspot.com.es/2013/07/eclipse-internal-browser-is-not.html
另见:https: //rusya7.blogspot.com.es/2013/07/eclipse-internal-browser-is-not.html