9

On my Arch Linux, Eclipse with Google Window Builder/SWT application, I am getting

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?

UPDATE 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.

Then I also tried downloading and extracting xulrunner from mozilla to ~/xulrunner and adding -Dorg.eclipse.swt.browser.XULRunnerPath=/home/jiewmeng/xulrunner/ to config, still same error...

In Ubuntu just now, I just installed xulrunner and it worked... I wonder if the config is even used?

Arch Linux Question

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)

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)
11
  • You've probably already seen this thread, but you're not alone on this problem in Arch Linux: stackoverflow.com/questions/7130980/…
    – MrGomez
    Mar 23, 2012 at 2:44
  • And, out of extremely dumb, naive curiosity on my part, what versions of Eclipse and Mozilla Firefox do you have installed? Note the supported list of WebKit and Mozilla versions per version of Eclipse, in addition to the caveat about linkable Gecko libraries. Compiling Firefox yourself may actually resolve your problem: eclipse.org/swt/faq.php#browserlinux
    – MrGomez
    Mar 23, 2012 at 3:10
  • @MrGomez, I just saw this comment, I am using Firefox 11, hmm compile myself ... where do I get the sources? Its said that the one at mozilla does not fulfil the criteria?
    – Jiew Meng
    Mar 24, 2012 at 10:07
  • @MrGomez, do you happen to know if installing from the AUR is the same as compiling from source?
    – Jiew Meng
    Mar 24, 2012 at 10:21
  • It should be close enough for government work. And, it turns out the Mozilla Gecko SDK and XULRunner are one and the same now, so it's basically installing another version of XULRunner on your system to try. Failing this, if you're able to install libwebkit instead of libwebkit3 on your system and use the WebKit configuration options as before, that has a high success rate. Sorry for the trouble, in any event.
    – MrGomez
    Mar 24, 2012 at 10:30

6 Answers 6

7
+500

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 documentation and dependency hell.

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 here and 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.

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:

  • 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:

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]".

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... :)


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.

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 whole lot of necessary fixups, my make install version just works with Eclipse.

The next step, for anyone willing, is to report this to Arch Linux.

7
  • Is it a problem if I am using GNOME 3 (its GTK3 I think, but GTK2 is installed too)? Also I put -Dorg.eclipse.swt.browser.XULRunneaarPath=/home/jiewmeng/xulrunner (xulrunner 1.9.2) in eclipse.ini but it still fails. I mis-spelt the option, eclipse still runs, is the config run at all?
    – Jiew Meng
    Mar 24, 2012 at 4:29
  • GNOME 3 isn't known to cause issues according to the documentation. Also to my understanding, the configuration changes you have made to eclipse.ini are parsed directly by the JVM used to run Eclipse, and in that capacity, misspelled options are discarded. The invocation will, indeed, need to be -Dorg.eclipse.swt.browser.XULRunnerPath to work effectively. If you wish to check if the ini is being ignored, consider passing this directly to eclipse as -vmargs, as here: help.eclipse.org/indigo/…
    – MrGomez
    Mar 24, 2012 at 4:41
  • I tried ./eclipse -vmargs -Dorg.eclipse.swt.browser.XULRunnerPath=/home/jiewmeng/xulrunner, and I got the same error. The directory looks like i.imgur.com/h2HxL.png. I will update my original post on detailed environment & versions.
    – Jiew Meng
    Mar 24, 2012 at 5:06
  • Excellent, thank you. Now that we know your software versions, I can point you to this article, which includes a set of alternative workarounds and a patch. Do these work for you?
    – MrGomez
    Mar 24, 2012 at 5:27
  • I think those are already what I tried (using a local xulrunner, use libwebkit). I think what might be the problem is the config doesn't appear to change anything? eg. when I set it to use webkit, it appears to be using MOZILLA still? Using a local xulrunner should work, but maybe its not using the right copy? Is ./eclipse -vmargs -Dorg.eclipse.swt.browser.XULRunnerPath=/home/jiewmeng/xulrunner right?
    – Jiew Meng
    Mar 24, 2012 at 8:34
3

This steps worked for me with STS 2.9.2 based on Eclipse 3.7.2 (Ubuntu 12.04 - 64bits):

  1. 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".
  2. Restart Eclipse and verify that trying to design a GWT UIBinder view with WindowBuilder fails showing an error related to xulrunner.
  3. Close Eclipse.
  4. 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
  5. Start Eclipse again and check that WindowBuilder Desing view works!
1

In my case I just had to install 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

0
0

See browser QA in SWT FAQ

9
  • I suppose I will end up eclipse.org/swt/faq.php#browserwebkitgtk. "WebKitGTK 1.2.0 or newer must be in the library load path" how will I do that? How do I know where webkitgtk is?
    – Jiew Meng
    Mar 14, 2012 at 3:43
  • On Ubuntu you can find a package via 'dpkg -l|grep <package-name>'. Then 'apt-file show libwebkitgtk-1.0-0' to find the path of libraries. I never use arch linux before, not sure how to find a package from it.
    – Kane
    Mar 14, 2012 at 4:54
  • What files do I need? Whats installed by pywebkitgtk is pastie.org/3591807.
    – Jiew Meng
    Mar 14, 2012 at 8:01
  • @JiewMeng See this answer. First of all, SWT requires libgtkwebkit, not pywebkitgtk. And Eclipse/SWT 3.6.x is only able to use WebKitGTK 1.2.x. If you are using newer WebKitGtk, try to use SWT 3.7.x.
    – Kane
    Mar 14, 2012 at 10:00
  • I edited my /usr/share/eclipse/eclipse.ini to have -Dorg.eclipse.swt.browser.DefaultType=webkit -Dorg.eclipse.swt.browser.UseWebKitGTK=true but nothing have changed. I still get the same error ... I believe I still dont know how to add the library load path
    – Jiew Meng
    Mar 14, 2012 at 10:26
0

MOZILLA_FIVE_HOME not set for eclipse pluging or any pluging gives unhandled error please do the follwoing process and you are done.

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.

  1. Download and Install libhunspell-1.2-0 from here and install it.

    sudo dpkg -i libhunspell-1.2-0_1.2.14-4_amd64.deb
    
  2. Download and install xulrunner-1.9.2 from here and install it.

    sudo dpkg -i xulrunner-1.9.2_1.9.2.28+build1+nobinonly-0ubuntu0.11.04.1_amd64.deb

0

In Arch linux, based on the answer of @mrgomez and the FAQs provided installing:

# pacman -S webkitgtk2

solved the problem!

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.