There is quite a lot of noise regarding this error in the Internet. It is being triggered by Eclipse’s (and Eclipse-based products’) SWT, whenever it tries to generate a ‘browser’ window (like the one used when you do git commit in Aptana).
The root cause of this error is that Eclipse’s SWT cannot find Mozilla’s Xulrunner, which it uses to draw ‘browser’ windows. It seems that the problem appeared with Firefox 3.0 (at least I’ve found a post of a guy who wrote he started to see this after his Firefox upgraded from 2.x to 3.0). For some reason SWT does not support Xulrunner of versions greater than 1.9.2.
Well, all the solutions found on StackOverflow, forums, bug trackers seem invalid. They all suggest to define the MOZILLA_FIVE_HOME environment variable and point it to the Xulrunner installation (wherever it’s installed, with the requirement that the directory should contain libxpcom.so). In my case the result was that even the downloaded and extracted old Xulrunner 1.9.2 refused to work.
Then, on the Eclipse SWT FAQ page I found out that you can define custom path to Xulrunner Eclipse should be using. This is done with org.eclipse.swt.browser.XULRunnerPath option. But my downloaded and extracted Xulrunner distribution refused to work this way.
Then I started searching for an Ubuntu package of that old Xulrunner 1.9.2 (thought it could be that the lib should actually reside in the lib path). Since Xulrunner seems no longer being distributed apart from Firefox (at least in Ubuntu), there is not separate Xulrunner package for Ubuntu in the repositories. But I was lucky to find one for Oneiric on Launchpad here
So, basically, the steps to fix the error are the following:
- Download and install Xulrunner deb package from the Launchpad page above
- Add
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.9.2.17option to youreclipse.ini(AptanaStudio3.ini)
That should fix the problem.
Thanks to Bruno Carlin for the insight
Thanks for the tip. I had the same error when running the old Eclipse Memory Analyzer tool, based on Eclipse RCP (like Aptana), but was stuck while installing the old xulrunner from your link
” /usr/lib/xulrunner-1.9.2.17/xulrunner-bin: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory ”
(even while installing the libmozjs from the repository through libmozjs185-1.0 + libmozjs185-dev)
I had to create the file /etc/ld.so.conf.d/xulrunner.conf with that single line :
/usr/lib/xulrunner-1.9.2.17
then run “sudo ldconfig” and dpkg -i the .deb again (and then everything worked)
Honestly all that xulrunner stuff is a real mess, i had several issues with that over time.