0

after spending a day reading here and there I decided to ask help as I could not find a solution to my problem.

I have to create a java/swt application embedding a browser with full HTML5 support. That works out of the box on both linux and osx with SWT.NONE browser type (using webkit). Unfortunatelly I have lot of troubles on windows.

First let me say that I'm using SWT 4.2.x on windows 8 64 bit.

To make SWT browser work with webkit I had to install 32bit JVM and manually point to it (as the -d32 switch on default 64bit JVM says that no 32 bit JVM is installed). ALso installed Safari. And also I had to use 32bit SWT library. WHen finally I got it run I discovered that Safari for windows does not support drag and drop as experienced and stated here:

http://www.w3schools.com/html/html5_draganddrop.asp

So I decided to switch to mozilla. According to Eclipse/SWT documentation I have downloaded and installed XULRunner 1.8.0.1. I have unzipped it into C:\Program Files (x86)\Mozilla\XULRunner\1.8.0.1\xulrunner and run xulrunner --register-user (and also --register-global)

Finally in my code I added

System.setProperty("org.eclipse.swt.browser.DefaultType", "mozilla");

I have also set a global environment variable "MOZILLA_FIVE_HOME" pointing to the same XULRunner installation dir.

But then, when I run my java program (32bit JRE, 32bit SWT) I get

Exception in thread "main" org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME may not point at an embeddable GRE]

How can I fix that? Thanks in advance!

EDIT: I was running command prompt not as administrator and xulrunner was not registering. Doing as administrator, worked. However I'm still in trouble: XULRunner 1.9.x seems not to support HTML5. For example element.children is not supported. I managed installing XULRunner 10.0.2 that seems to have the required support. However as soon as I click into my embedded browser, the application just crashes without printing any error on java output console...

I need to find a solution in order to use either ecent version of mozilla or recent version of webkit on windows

lviggiani
  • 5,824
  • 12
  • 56
  • 89

2 Answers2

0

Ok, loading XURLRunner 10.0.2 works. The crashing app was due to a stack overflow error in my js code.

lviggiani
  • 5,824
  • 12
  • 56
  • 89
0

I too am trying to embed XULRunner into my eclipse plug-in, with no luck (currently). I came across your answer here. Just wanted to comment that it is not reasonable that you executed

xulrunner --register-user

nor

xulrunner --register-global

on the XULRunner 10.X since according to this post https://stackoverflow.com/a/7567781/1743693 the support on installing the XULRunner system-wide was removed (which was a good step IMHO)

Trying to execute the aforementioned commands will result

"Error: couldn't parse application.ini"

As for my problem: I keep running into the runtime error:

Can't load library: C:\Users\david\.swt\lib\win32\x86_64\swt-xulrunner-win32-4236.dll C:\Users\david\.swt\lib\win32\x86_64\swt-xulrunner-win32.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform

And I can't figure out where this is coming from.

I'm running a VirtualBox with Windows 8 64bit

If you can elaborate more on what solved your issue with that - i would really appreciate that.

Thanks.

Community
  • 1
  • 1
orberkov
  • 1,145
  • 2
  • 13
  • 27