I'm having a little trouble with the SWT Browser component. I am running Ubuntu 11.04 AMD64 and Eclipse 3.7, with Java SE 1.6 from Sun
My problem is that my browser won't initialize. When I make it with the SWT.NONE flag, I get errors
Exception in thread "main" org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3346 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file)
at org.eclipse.swt.SWT.error(SWT.java:3589)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:324)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:109)
at browser.Main.createGUI(Main.java:40)
at browser.Main.main(Main.java:21)
Caused by: java.lang.UnsatisfiedLink开发者_运维技巧Error: no swt-mozilla-gtk-3346 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:219)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:309)
... 3 more
And then when I try to use the SWT.MOZILLA flag, I get
Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Could not detect registered XULRunner to use]
at org.eclipse.swt.SWT.error(SWT.java:3589)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:280)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:109)
at browser.Main.createGUI(Main.java:40)
at browser.Main.main(Main.java:21)
I suspect this is partly because I am using XULRunner2, but I would prefer to use WebKit, which in Eclipse 3.7 (that's why I upgraded), should be default when using SWT.NONE.
If any of you have run into this problem and/or have solved it before, I would appreciate it if you could help me.
Thanks!
According to SWT FAQ you may have unsupported XULRunner2 (try older versions). You should also check if you have installed WebKitGTK+ 1.2.x for WebKit browser core.
EDIT
Edited based on your comments. Accordingly to this FAQ you should have WebKitGTK 1.2.0 or newer in the library load path, so check if you have.. And create browser with SWT.NONE..
The error message you get from SWT said so you don't have the library on the path you should
java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3346 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file
精彩评论