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.
- Check the version of
libwebkit-1.0-2
(it should be >= 1.2.0) - Install this package if absent
- Check that
/usr/lib
and/usr/lib/jni
is injava.library.path
- If you use SWT 3.6, also check that appropriate webkit jni wrapper is installed (e.g.
libswt-webkit-gtk-3.6-jni
andorg.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
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)
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
I Cannot Get a Result from a Single Line Put into the Erlang Shell
Curl Command for Https ( Ssl )
Configuring Selinux Permissions on (Svs-V) Ipc Semaphores
What Do the Characters in the Bash Environment Variable $- Mean
Shell Script Printing Contents of Variable Containing Output of a Command Removes Newline Characters
Cmake:How to Change File Permissions When Installing
Using Sed to Get the Last N Lines of a Huge Text File
How to Combine Two Variable Column-By-Column in Bash
Prepend Data from One File to Another
Linux, Print All Lines in a File, Not Starting With
Installing G++ on Windows Subsystem for Linux
What Does This Command Do? "Exec Bash -L"
How to Change Version String of the Kernel
Newbie on Debian and Trying to Make Java 7 the Default Java Version Used