Reputation: 214
What's wrong with XULRunner So, I have next environment:
So,
public class Main {
public static void main(String[] args) {
System.setProperty("org.eclipse.swt.browser.DefaultType", "mozilla");
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "/opt/xulrunner/xulrunner");
Display display = new Display();
final Shell shell = new Shell(display);
Browser webBrowser = new Browser(shell, SWT.MOZILLA);
GridData grid = new GridData(GridData.FILL_BOTH);
webBrowser.setLayoutData(grid);
String graphUrl = "http://google.com";
webBrowser.setUrl(graphUrl);
}
}
But in Eclipse i see:
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Browser style SWT.MOZILLA and Java system property org.eclipse.swt.browser.DefaultType=mozilla are not supported with GTK 3 as XULRunner is not ported for GTK 3 yet]
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.browser.MozillaDelegate.<init>(Unknown Source)
at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
at Main.main(Main.java:31)
Doesn't help:
XULRunner error in Eclipse / SWT
How to install XULRunner for Eclipse
How to make SWT Browser control use Mozilla instead of IE on Windows?
Upvotes: 3
Views: 5580
Reputation: 146
XULRunner is not ported to GTK3 yet, so you have to make it run in GTK2 mode by editing eclipse.ini, which you will find in the eclipse installation dir.
Check to see if your eclipse.ini contains a line that starts with --launcher
, for example
--launcher.appendVmargs
Put the following two lines before that one:
--launcher.GTK_version
2
Yes, they need to be on separate lines.
If you don't find a line that starts with --launcher.
, find a line that says just --vm
and put those two lines on the lines before it, and if you don't find a --vm
line, put it on the line before --vmargs
.
You should then end up with a file that looks like this. Note this is just an example:
--launcher.GTK_version
2
--launcher.appendVmargs
OR
--launcher.GTK_version
2
--vm (or --vmargs)
Upvotes: 10
Reputation: 376
The problem you have here Xulrunner doesnot have GTK3 port. you eclipse runs in GTK3 mode by default. so it is unable to load Xulrunner libraries. Please start eclipse in GTK2 mode and try. you can do this by
add these lines to eclipse.ini (please note this has to be before vmargs)
-launcher.GTK_version 2
Upvotes: 3