RCP with SWT.Browser and XULRunner

I am developing an RCP application (Windows) using SWT.Browser (SWT.MOZILLA):

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

It works great with old XULRunner 3.6.23, and the setup described here is :

 xulrunner.exe --register-global 

I want to use the new XULRunner 8.x, but as mentioned here , the old XULRunner installation method has been removed.

So, programmatically, I added the XULRunner-Path:

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

But when I run the application, I will get the following error

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

So, what is the preferred way to insert XULRunner 8.x with an RCP application and avoid this error?

+7
source share
4 answers

In Eclipse 3.8 / 4.2 M6, org.eclipse.swt.browser now supports the XULRunner 10.0.x attachment, but you should send XULRunner 10 runtime and explicitly point to it as described in the FAQ :

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

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

JavaXPCOM

Mozilla no longer supports JavaXPCOM, but as Grant Gayed says :

The browser does not require JavaXPCOM to work, it simply exposes it to applications that want to use it themselves using the getWebBrowser () method.

Linux

XULRunner 10 does not currently run under Linux due to Mozilla error 720682 .

+7
source

For Windows, you can also use Internet-Explorer as a browser until eclipse properly supports xulrunner (will be in version 4.3.x).

For IE:

just specify

  -Dorg.eclipse.swt.browser.DefaultType=ie,mozilla 

in eclipse.ini .

You can read about it here .

+2
source

I am running Windows7 (64 bit) and have a new xulrunner vresion: 31.0.0 ([ http://wiki.mozilla-x86-64.com/Download†[1] )

But when I try to give the path, it gave me the System.setProperty error ("org.eclipse.swt.browser.XULRunnerPath", "path \ to \ xulrunner_31 \");

 java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processCommandResult(MessagingInterface.java:342) at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.syncSend(MessagingInterface.java:329) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.syncSend_(SWTNativeInterface.java:392) at chrriis.dj.nativeswing.swtimpl.NativeInterface.syncSend(NativeInterface.java:104) at chrriis.dj.nativeswing.swtimpl.Message.syncSend(Message.java:64) at chrriis.dj.nativeswing.swtimpl.CommandMessage.syncExec(CommandMessage.java:55) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.runSync(SWTNativeComponent.java:201) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.createNativePeer(SWTNativeComponent.java:1009) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent.access$17(SWTNativeComponent.java:989) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$12.run(SWTNativeComponent.java:882) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738) at java.awt.EventQueue.access$300(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:699) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:708) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeComponent$CMN_createControl.run(SWTNativeComponent.java:663) at chrriis.dj.nativeswing.swtimpl.CommandMessage.runCommand(CommandMessage.java:61) at chrriis.dj.nativeswing.swtimpl.NativeInterface.runMessageCommand(NativeInterface.java:172) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.runMessageCommand(SWTNativeInterface.java:1429) at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.runMessage(MessagingInterface.java:121) at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.processReceivedMessages(MessagingInterface.java:106) at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface.access$2(MessagingInterface.java:94) at chrriis.dj.nativeswing.swtimpl.core.MessagingInterface$2$2.run(MessagingInterface.java:442) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide(SWTNativeInterface.java:1352) at chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_(SWTNativeInterface.java:1461) at chrriis.dj.nativeswing.swtimpl.NativeInterface.main(NativeInterface.java:224) Caused by: org.eclipse.swt.SWTError: XPCOM error 0x80004005 at org.eclipse.swt.browser.Mozilla.error(Unknown Source) at org.eclipse.swt.browser.Mozilla.initXULRunner(Unknown Source) at org.eclipse.swt.browser.Mozilla.create(Unknown Source) at org.eclipse.swt.browser.Browser.<init>(Unknown Source) at chrriis.dj.nativeswing.swtimpl.components.core.NativeWebBrowser.createControl(NativeWebBrowser.java:431) ... 19 more 

Without it, it shows IE 9.0 or with another xulunner, which I do not confirm where it works from, but it shows firefox version 5.0. Any idea how I can update the latest version of Firefox.

0
source

Eclipse_4.4.2 now supports XULRunner24.0, you can try this version.

0
source

All Articles