How to Get Eclipse Swt Browser Component Running on Ubuntu 11.04 (Natty Narwhal) with Webkit

How to get Eclipse SWT Browser component running on Ubuntu 11.04 (Natty Narwhal) with Webkit?

I'm not on Ubuntu, but think that doesn't matter much.

  1. Check the version of libwebkit-1.0-2 (it should be >= 1.2.0)
  2. Install this package if absent
  3. Check that /usr/lib and /usr/lib/jni is in java.library.path
  4. If you use SWT 3.6, also check that appropriate webkit jni wrapper is installed (e.g. libswt-webkit-gtk-3.6-jni and org.eclipse.swt.browser.UseWebKitGTK system property is set to `True

Edit: To localize source of the problem create minimalistic project and show the output

package foo;

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class BrowserTest {

public static void main(String[] args) {

System.out.println(System.getProperty("java.library.path"));
System.out.println(System.getProperty("org.eclipse.swt.browser.UseWebKitGTK"));

Display display = new Display();
Shell shell = new Shell(display);

try {
Browser browser = new Browser(shell, SWT.NONE);
browser.setSize(shell.getSize());
browser.setUrl("google.com");
} catch (SWTError e) {
e.printStackTrace();
}

shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}

display.dispose();

}
}

SWT.WebKit doesn't load: No More Handles - [Safari must be installed to use a SWT.WEBKIT-style Browser]

The reason is that Apple moved the "Apple Application Support" folder in the latest Safari installers from

C:\Program Files (x86)\Common Files\Apple\Apple Application Support\

to

C:\Program Files (x86)\Common Files\Apple\.

SWT simply cannot find it (see this bug).

There are two workarounds until SWT support of the new folder is added:

  • Install Apple QuickTime or iTunes - they still place "Apple Application Support" in C:\Program Files (x86)\Common Files\Apple\
  • Or add APPLE_INSTALLATION_DIR\Apple Application Support\ to the PATH environment variable

Trouble with Browser type SWT.MOZILLA on windows 8 64 bit

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

How do I install XULRunner 1.8.x/libxul0d on Ubuntu Lucid Lynx (10.x)? Required for Eclipse SWT Browser


  1. Download the following files from the karmic repository (NOT lucid):

    • libmozjs0d(http://packages.ubuntu.com/karmic/amd64/libmozjs0d/download)
    • libxul-common(http://packages.ubuntu.com/karmic/libxul-common)
    • libxul0d(http://packages.ubuntu.com/karmic/libxul0d)
    • xulrunner(http://packages.ubuntu.com/karmic/xulrunner)
  2. Install the packages, in the order given, using the following command.

    sudo dpkg -i ~/Desktop/.deb

Note that it may be possible to use apt-get to pin the karmic repository(https://help.ubuntu.com/community/UbuntuBackports) but I haven't tried this.

The issue is that the Reports are loading a browser via SWT. The SWT code then goes looking for a browser and tries to find various required shared libraries. XULRunner is the core Firefox browsing functionality which is now v1.9 in the lucid repositories. However, SWT v3.3.0 (as we have) requires v1.8 which is in karmic.



Related Topics



Leave a reply



Submit