Eclipse Luna force loads gtk3 libs on Linux / Unix - https://bugs.eclipse.org/bugs/show_bug.cgi?id=420182
Every time after running the above sample against gtk3 libs, the native error will appear.
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import javafx.embed.swt.FXCanvas;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
public class JavaFxBrowser extends FXCanvas {
public JavaFxBrowser(Composite parent) {
super(parent, SWT.NONE);
WebView browser = new WebView();
this.setScene(new Scene(browser));
WebEngine webEngine = browser.getEngine();
webEngine.load("http://www.oracle.com");
}
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
JavaFxBrowser javaFxBrowser = new JavaFxBrowser(shell);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
SWT_GTK3=1 - this environmental variable should be added