Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RCP with SWT.Browser and XULRunner

Tags:

swt

rcp

xulrunner

I'm developing an RCP application (Windows) with SWT.Browser (SWT.MOZILLA):

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

It's working fine with the old XULRunner 3.6.23 and the installation described here:

xulrunner.exe --register-global

I want to use the new XULRunner 8.x, but as mentioned here the old way to install XULRunner was removed.

So I added the XULRunner-Path programmatically:

System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "Path\\To\\xulrunner_8.x"); 

But when I start my application, I'll get the following error

org.eclipse.swt.SWTError: XPCOM error -2147467261

So what's the preferred way to embed XULRunner 8.x with an RCP application and avoiding this error?

like image 824
TimPietrusky Avatar asked Oct 25 '11 14:10

TimPietrusky


1 Answers

As of Eclipse 3.8 / 4.2 M6 the org.eclipse.swt.browser now supports embedding XULRunner 10.0.x, but you must ship a XULRunner 10 runtime and explicitly point at it as described in the FAQ:

...    
    System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "path\to\xulrunner_10"); 
...

The XULRunner 10 runtime can be downloaded from ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/10.0/runtimes/

JavaXPCOM

Mozilla is not maintaining JavaXPCOM anymore, but as Grant Gayed says:

The Browser does not require JavaXPCOM in order for it to work, it just exposes it to apps that want to use it themselves through its getWebBrowser() method.

Linux

XULRunner 10 will currently not run under Linux because of Mozilla bug 720682.

like image 179
TimPietrusky Avatar answered Oct 22 '22 14:10

TimPietrusky