Thursday, January 24, 2008

How to solve the rcp-mozilla-browser exception problem in linux

As most of you probably know, the Eclipse-rcp environment uses native GUI resources, which steals to java the whole portability fun. The nice thing about it is that SWT looks 1000000 times better than swing (in the author's opinion).

One problem that could occur, is that some of the underlying resource is not found from time to time, as for example in the case of Linux OS and the swt browser widget.

The error thrown in that case is something like:
Exception in thread "Thread-3" org.eclipse.swt.SWTError: No more
handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
at org.eclipse.swt.SWT.error(SWT.java:3589)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:292)
at org.eclipse.swt.browser.Browser.(Browser.java:109)
at...

It seems that the environmental variable MOZILLA_FIVE_HOME has not been set, so let's try to set it.
In my case I add to my .bashrc the following line:

export MOZILLA_FIVE_HOME=/usr/lib/mozilla-firefox/

and magic is done! (please take care that the folder is the right one. For example on my newest linux it is: /usr/lib/firefox/)

If the magic at that point should not be done, then probably you need to run:

sudo apt-get install xul-runner





Post a Comment