4

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.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.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!

iAndr0idOs
  • 257
  • 4
  • 14

1 Answers1

2

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

Sorceror
  • 4,835
  • 2
  • 21
  • 35
  • How do I check for WebKitGTK+? libgtk-1.0-2 has been removed from the Ubuntu archives. I don't know how else to get it. I can get a browser working in GTK with #import , but Java won't recognize it? O_O – iAndr0idOs Jun 21 '11 at 19:20
  • Try this way [Ubuntu WebKit](https://help.ubuntu.com/community/WebKit) but I'm not linux user.. Did you try the old version o XULRunner? – Sorceror Jun 22 '11 at 08:56
  • Yeah I did that. I tried it twice. It works with C and Python, but it won't work with SWT And I don't want to downgrade my XULRunner. I would prefer Webkit to Mozilla – iAndr0idOs Jun 22 '11 at 18:13