From the notes on using XULRunner here, it looks like using version 10.x is correct.
I was able to get your code running by downloading XULRunner 10.0.4esr. I followed the installation steps given in this answer, as well as pointing to the bin
directory specifically.
- Download
xulrunner-10.0.4esr.en-US.win32.sdk.zip
from this directory
- Extract the contents and move the
xulrunner
directory to some location (I used c:/xulrunner
, but in your case C:/Program Files (x86)/XULRunner
should be fine too.
- Either use the VM argument (
-Dorg.eclipse.swt.browser.XULRunnerPath
), or use System.setProperty()
as you are currently. Be sure that the path that you specify points to the bin
directory, not just the top level xulrunner
directory.
Make sure you have that version of XULRunner (and specifically the SDK), and verify that the file path you are pointing to exists. Depending on where you unzip the download, you may need to replace:
String pathToXulrunner = "C://Program Files (x86)/Mozilla XULRunner/";
with:
String pathToXulrunner = "C:/Program Files (x86)/Mozilla XULRunner/bin";
I'm also running 64-bit Windows 10 with SWT 4.5.2, so we should have the same setup.
Edit: I just realized I was doing this with 32-bit libraries (32-bit Java and 32-bit SWT). So if you're by any chance using 32-bit libraries, this should work. According to this answer you should be able to use XULRunner 24 with a 64-bit JRE, however I was not able to get this working.
Edit 2: For 64-bit libraries, I found the contents of the bin directory for xulrunner-1.9.2.25 here: https://osdn.net/projects/sfnet_runawfe/downloads/SRC%20and%20BIN%20files/extras/xulrunner-1.9.2.25-win64.zip/
With this downloaded, I was able to run your code. Note that this is the contents of the bin
directory (equivalent to downloading the runtimes instead of the SDK), so you can exclude the bin
from your file path for pathToXulrunner
.
I can't right this minute, but I'll host this somewhere else and update the post later.
Edit 3: I've re-hosted this as xulrunner-1.9.2.25.en-US.win64.zip
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…