-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Native Image] Not able to launch native App created using SWT #9810
Comments
Here is the sample code to reproduce the issue.
Please any one help me on this |
Hi, can you please provide a complete reproducer? the example you shared is missing the imports and the dependencies needed to compile it |
package test; public class SimpleShell {
} org.eclipse.platform org.eclipse.swt.win32.win32.x86_64 3.126.0Please find the sample code and SWT dependency which I have used @oubidar-Abderrahim let me know if you need more details |
Describe the Issue
I'm getting the following exception when I try to launch the native app which created using swt.
SWT version:3.126.0
JDK:21
GraalVM Version:graalvm-jdk-21.0.4+8.1
When I try to load shell = new Shell(SWT.CLOSE | SWT.MIN);I'm getting the following error.
I'm passing all config files(proxy-config.json, reflect-config.json, jni-config.json, resource-config.json)
Exception in thread "main" java.lang.NoSuchFieldError: org.eclipse.swt.internal.win32.GESTURECONFIG.dwBlock
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$Support.getFieldID(JNIFunctions.java:1357)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.GetFieldID(JNIFunctions.java:449)
at org.eclipse.swt.internal.win32.OS.SetGestureConfig(Native Method)
at org.eclipse.swt.widgets.Control.checkGesture(Control.java:692)
at org.eclipse.swt.widgets.Control.createWidget(Control.java:709)
at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:160)
at org.eclipse.swt.widgets.Decorations.createWidget(Decorations.java:375)
at org.eclipse.swt.widgets.Shell.(Shell.java:318)
at org.eclipse.swt.widgets.Shell.(Shell.java:281)
at org.eclipse.swt.widgets.Shell.(Shell.java:207).
Can someone please help me on this!!!
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
I have tried with
1.graalvm-jdk-21.0.4+8.1, java 21 version and
2.Java 17 and graalvm-ce-java17-22.3.1.
Operating System and Version
Windows 11
Diagnostic Flag Confirmation
-H:ThrowMissingRegistrationErrors=
flag.Run Command
just double click on native image.
Expected Behavior
it should launch an app with login credentials.
Actual Behavior
its throwing an error which is mentioned above.
Steps to Reproduce
Just create simple swt application to open dialogue box and run native image.
Additional Context
No response
Run-Time Log Output and Error Messages
No response
The text was updated successfully, but these errors were encountered: