Bug 551618 - SWT_AWT Unsatisfield Link Error on Linux and Error on MacOSX
Summary: SWT_AWT Unsatisfield Link Error on Linux and Error on MacOSX
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.13   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-09-30 04:25 EDT by Marcel Austenfeld CLA
Modified: 2019-10-15 10:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Austenfeld CLA 2019-09-30 04:25:46 EDT
When I try to use the SWT_AWT bridge with OpenJDK 13 and Eclipse 2019-09 R (4.13.0) I run into a java.lang.UnsatisfieldLinkError. 

On Windows 10 everything runs fine.

The error occurs on Ubuntu 19.04 and maybee on MacOSX 10.14.6 (here I got no error message but the SWT_AWT panels are not painted, etc.)

With OpenJDK 12 everything runs fine.

It seems that the native libraries for Linux and Mac can't be found

The error can be reproduced, e.g., with the following example (source from: http://www.java2s.com/Tutorial/Java/0280__SWT/EmbededSwingAWTcomponentstoSWT.htm):

import javax.swing.JScrollPane;
import javax.swing.JTree;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class EmbedSwingAWTSWT {
  public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("SWT and Swing/AWT Example");

    Composite treeComp = new Composite(shell, SWT.EMBEDDED); 

    treeComp.setBounds(5,5,300,300);
    
    java.awt.Frame fileTableFrame = SWT_AWT.new_Frame(treeComp);
    java.awt.Panel panel = new java.awt.Panel(new java.awt.BorderLayout());
    fileTableFrame.add(panel);
    JTree fileTable = new JTree();
    fileTable.setDoubleBuffered(true);
    JScrollPane scrollPane = new JScrollPane(fileTable);
    panel.add(scrollPane);

    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    display.dispose();
  }
}
Comment 1 Eric Williams CLA 2019-09-30 13:58:29 EDT
Does it work if you run the snippet from the command line (i.e. not in Eclipse)?
Comment 2 Marcel Austenfeld CLA 2019-10-01 03:35:45 EDT
I exported the example as a runnable jar from Eclipse and from the command line executed:
./java -jar SWT_AWT.jar

With OpenJDK 13 I can reproduce the exact same error.

Once again with OpenJDK 11/12 everything runs fine.

I also read the release notes of Openjdk 13. However was not able to identify
breaking changes:

https://jdk.java.net/13/release-notes

Only the removal of awt.toolkit System Property looks suspicious.
Comment 3 Marcel Austenfeld CLA 2019-10-15 10:21:06 EDT
Any news about this bug?