Score:0

Ubuntu 18: eclipse fails while attempting to load SWT libraries

pe flag

I am running latest eclipse, and when I open WindowBuilder JTable's model's diaglog, I get this error:

Blockquote org.eclipse.swt.SWTError: Unspecified error [Error while starting AWT] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: /media/Backup/eclipse/java-2021-09/eclipse/configuration/org.eclipse.osgi/333/0/.cp/libswt-awt-gtk-4946r21.so: /usr/lib/jvm/jdk-17/lib/libjawt.so: version SUNWprivate_1.1' not found (required by /media/Backup/eclipse/java-2021-09/eclipse/configuration/org.eclipse.osgi/333/0/.cp/libswt-awt-gtk-4946r21.so) no swt-awt-gtk in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib no swt-awt in java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt-gtk-4946r21.so: /usr/lib/jvm/jdk-17/lib/libjawt.so: version SUNWprivate_1.1' not found (required by /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt-gtk-4946r21.so) Can't load library: /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt-gtk.so Can't load library: /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt.so /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt-gtk-4946r21.so: /usr/lib/jvm/jdk-17/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /home/abusous2000/.swt/lib/linux/x86_64/libswt-awt-gtk-4946r21.so) ) at org.eclipse.swt.SWT.error(SWT.java:4919) at org.eclipse.swt.awt.SWT_AWT.new_Frame(SWT_AWT.java:168) at swingintegration.example.EmbeddedSwingComposite2.createFrame(EmbeddedSwingComposite2.java:338) at swingintegration.example.EmbeddedSwingComposite2.populate(EmbeddedSwingComposite2.java:196) at org.eclipse.wb.internal.swing.model.property.editor.models.table.TableModelDialog.createDialogArea(TableModelDialog.java:147) at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:767) at org.eclipse.jface.window.Window.create(Window.java:431) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094) at org.eclipse.jface.window.Window.open(Window.java:788) at org.eclipse.wb.internal.swing.model.property.editor.models.table.TableModelPropertyEditor.openDialog(TableModelPropertyEditor.java:81) at org.eclipse.wb.internal.core.model.property.editor.TextDialogPropertyEditor$1.onClick(TextDialogPropertyEditor.java:35) at org.eclipse.wb.internal.core.model.property.editor.presentation.ButtonPropertyEditorPresentationImpl$4.handleEvent(ButtonPropertyEditorPresentationImpl.java:124)

It should be noted that

  • I get this error even if I run JDK 11, 15, or 17. Even I tried Oracle JDK as some have suggested

  • I linked the JNI files locally be executing ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

  • I installed latest jni by executing sudo apt-get install libswt-gtk-4-jni libswt-gtk-4-java

  • I tested this on Ubuntu 16, & got the same error

Really I am at a lose. This is leads me to believe this is an OS issue

Score:0
pe flag

Once I downgraded my environment to Eclipse Luna, WindowBuilder 1.9.0, & to Oracle 8 JDK, it did work. Therefore it is related to latest eclipse & JDK. I hope this helps someone else who ran into a similar issue. Anyhow, I am curious to know why this failed! I like to use latest eclipse whenever I can.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.