- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.8k
 
Description
Describe the Issue
I have code which calls Desktop.isDesktopSupported() and this compiles and runs fine with native-image on Ubuntu, but if I build it on Debian 12 then trying to run it errors with:
java.lang.NoSuchMethodError: sun.awt.X11.XErrorHandlerUtil.globalErrorHandler(JJ)I
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$Support.getMethodID(JNIFunctions.java:1855)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$Support.getMethodID(JNIFunctions.java:1840)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.GetStaticMethodID(JNIFunctions.java:443)
at java.desktop@25.0.1/sun.java2d.xr.XRSurfaceData.initIDs(Native Method)
at java.desktop@25.0.1/sun.java2d.xr.XRSurfaceData.initXRSurfaceData(XRSurfaceData.java:107)
at java.desktop@25.0.1/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:122)
at java.desktop@25.0.1/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:57)
at java.desktop@25.0.1/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:35)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:89)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:80)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:102)
at java.desktop@25.0.1/sun.awt.X11.XToolkit.(XToolkit.java:219)
at java.desktop@25.0.1/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:39)
at java.desktop@25.0.1/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:580)
at java.desktop@25.0.1/java.awt.Desktop.isDesktopSupported(Desktop.java:316)
Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
 
GraalVM Version
OpenJDK Runtime Environment GraalVM CE 25.0.1+8.1 (build 25.0.1+8-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 25.0.1+8.1 (build 25.0.1+8-jvmci-b01, mixed mode, sharing)
Operating System and Version
Debian 12
Troubleshooting Confirmation
- I tried the suggestions in the troubleshooting guide.
 
Run Command
./peergos
Expected Behavior
That method should return false if it isn't supported rather than throwing.
Actual Behavior
It throws NoSuchMethodError
Steps to Reproduce
Compile code that calls the method on Debian 12.
Additional Context
No response
Run-Time Log Output and Error Messages
java.lang.NoSuchMethodError: sun.awt.X11.XErrorHandlerUtil.globalErrorHandler(JJ)I
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$Support.getMethodID(JNIFunctions.java:1855)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions$Support.getMethodID(JNIFunctions.java:1840)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.GetStaticMethodID(JNIFunctions.java:443)
at java.desktop@25.0.1/sun.java2d.xr.XRSurfaceData.initIDs(Native Method)
at java.desktop@25.0.1/sun.java2d.xr.XRSurfaceData.initXRSurfaceData(XRSurfaceData.java:107)
at java.desktop@25.0.1/sun.awt.X11GraphicsEnvironment.initStatic(X11GraphicsEnvironment.java:122)
at java.desktop@25.0.1/sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:57)
at java.desktop@25.0.1/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:35)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:89)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment$LocalGE.(GraphicsEnvironment.java:80)
at java.desktop@25.0.1/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:102)
at java.desktop@25.0.1/sun.awt.X11.XToolkit.(XToolkit.java:219)
at java.desktop@25.0.1/sun.awt.PlatformGraphicsInfo.createToolkit(PlatformGraphicsInfo.java:39)
at java.desktop@25.0.1/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:580)
at java.desktop@25.0.1/java.awt.Desktop.isDesktopSupported(Desktop.java:316)