-
Notifications
You must be signed in to change notification settings - Fork 192
Closed as not planned
Description
Describe the bug
Statically loading a class that extends Scrollable ends in this exception on headless servers (e.g. ci/cd pipelines)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-pi4-gtk-4934r6 in java.library.path: [/opt/java/openjdk/lib/server, /opt/java/openjdk/lib, /opt/java/openjdk/../lib, /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
no swt-pi4-gtk in java.library.path: [/opt/java/openjdk/lib/server, /opt/java/openjdk/lib, /opt/java/openjdk/../lib, /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
Can't load library: /root/.swt/lib/linux/x86_64/libswt-pi4-gtk-4934r6.so
Can't load library: /root/.swt/lib/linux/x86_64/libswt-pi4-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:342)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:256)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:90)
at org.eclipse.swt.widgets.Scrollable.<clinit>(Scrollable.java:44)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
....
It seems that this call
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java
Line 46 in 603eecd
| static final boolean RESIZE_ON_GETCLIENTAREA = OS.isWayland() || Boolean.getBoolean("org.eclipse.swt.resizeOnGetClientArea"); |
causes the load of a native library
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
Line 82 in 603eecd
| static { |
we are analyzing the classes during our build and therefore load classes with Class.forName
I think we have this error wirh RCP 4.16 (have to check this in detail if necessary)
Environment:
- Select the platform(s) on which the behavior is seen:
-
- All OS
-
- Windows
-
- Linux
-
- macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels