| Summary: | no SWT Widget display in linux - java.lang.UnsatisfiedLinkError: Could not load SWT library. | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | amos <mountain14466> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, ericwill, mountain14466 |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
What build ? Please download and test using SWT 3.7 M1 http://download.eclipse.org/eclipse/downloads/drops/S-3.7M1-201008051700/index.php#swt |
Build Identifier: 1 I wrote a demo to put a swt into canvas. In windows ,it is OK and could show two buttons. import org.eclipse.swt.*; import org.eclipse.swt.awt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class SWTInAWT { public static void main(String[] args) { java.awt.Frame frame = new java.awt.Frame("AWT Frame"); java.awt.Button button = new java.awt.Button("AWT Button"); frame.add(button, java.awt.BorderLayout.NORTH); java.awt.Canvas canvas = new java.awt.Canvas(); frame.add(canvas, java.awt.BorderLayout.CENTER); frame.addNotify(); Display display = new Display(); Shell shell = SWT_AWT.new_Shell(display, canvas); shell.setLayout(new FillLayout()); Button swtButton = new Button(shell, SWT.PUSH); swtButton.setText("SWT Button"); frame.setBounds(20, 20, 300, 300); shell.layout(); frame.setVisible(true); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } } 2 when I run it in linux Redhat 5 EL, it will throwException. [root@vms74 test]# java -cp swt-3.6-gtk-linux-x86.jar:/home/shan/test -Djava.library.path=/home/shan/test SWTInAWT Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-pi-gtk-3650 in java.library.path no swt-pi-gtk in java.library.path /tmp/swtlib-32/libswt-pi-gtk-3650.so: /tmp/swtlib-32/libswt-pi-gtk-3650.so: undefined symbol: gtk_window_is_active Can't load library: /tmp/swtlib-32/libswt-pi-gtk.so at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source) at org.eclipse.swt.internal.gtk.OS.<clinit>(Unknown Source) at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source) at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source) at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source) at SWTInAWT.main(SWTInAWT.java:16) 3 I put the *.so in swt-3.6-gtk-linux-x86.jar into this directory. It also can not run. Reproducible: Always