Closed pquiring closed 11 months ago
Looks like the same problem I'm trying to deal with . In my menu text doesn't displays at all:
I tried to dig into jni-config
and reflect-config
but had no success
Thank you for reaching out about this, we'll take a look into it shortly
related to #4921
@oubidar-Abderrahim Is there any update?
Unfortunately, I wasn't able to reproduce the issue on my side. the native-image was built and run successfully using the latest dev build
@oubidar-Abderrahim I'll try the latest dev build. Maybe something has changed after 3 weeks
Tried latest dev build and problem remains.
It's also true for me
@oubidar-Abderrahim nothing has changed with the latest build
@oubidar-Abderrahim is it rendered correctly?
Unfortunately, I wasn't able to reproduce the issue on my side. the native-image was built and run successfully using the latest dev build
Yes, it rendered correctly, the only difference I can see is that I was using Windows 10.
@oubidar-Abderrahim I also use Windows 10 and problem remains.
@oubidar-Abderrahim can you post here link to exact build you've been using while trying to reproduce?
@oubidar-Abderrahim Also reflect- and jni- configs might help. It would be great if you will share them
@pquiring maybe you've made any progress with this issue?
Nothing yet.
>java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment GraalVM CE 21-dev+30.1 (build 21+30-jvmci-23.1-b10)
OpenJDK 64-Bit Server VM GraalVM CE 21-dev+30.1 (build 21+30-jvmci-23.1-b10, mixed mode, sharing)
I downloaded this build from an internal source, but it should be the same as the one in Github, I don't remember which build exactly though
resource-config.json
{
"resources":{
"includes":[]},
"bundles":[{
"name":"sun.awt.resources.awt",
"classNames":["sun.awt.resources.awt"]
}]
}
reflect-config.json
[
{
"name":"java.awt.SequencedEvent"
},
{
"name":"java.util.concurrent.atomic.AtomicBoolean",
"fields":[{"name":"value"}]
},
{
"name":"sun.awt.Symbol",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"sun.awt.windows.WingDings",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"sun.java2d.marlin.DMarlinRenderingEngine",
"methods":[{"name":"<init>","parameterTypes":[] }]
}
]
jni-config.json
[
{
"name":"[Lsun.java2d.loops.GraphicsPrimitive;"
},
{
"name":"java.awt.AWTEvent",
"fields":[{"name":"bdata"}, {"name":"consumed"}, {"name":"id"}]
},
{
"name":"java.awt.AlphaComposite",
"fields":[{"name":"extraAlpha"}, {"name":"rule"}]
},
{
"name":"java.awt.CheckboxMenuItem",
"fields":[{"name":"state"}]
},
{
"name":"java.awt.Color",
"methods":[{"name":"getRGB","parameterTypes":[] }]
},
{
"name":"java.awt.Component",
"fields":[{"name":"appContext"}, {"name":"background"}, {"name":"cursor"}, {"name":"enabled"}, {"name":"focusable"}, {"name":"foreground"}, {"name":"graphicsConfig"}, {"name":"height"}, {"name":"parent"}, {"name":"peer"}, {"name":"visible"}, {"name":"width"}, {"name":"x"}, {"name":"y"}],
"methods":[{"name":"getFont_NoClientCode","parameterTypes":[] }, {"name":"getLocationOnScreen_NoTreeLock","parameterTypes":[] }, {"name":"getToolkitImpl","parameterTypes":[] }, {"name":"isEnabledImpl","parameterTypes":[] }]
},
{
"name":"java.awt.Container",
"fields":[{"name":"layoutMgr"}]
},
{
"name":"java.awt.Cursor",
"fields":[{"name":"pData"}, {"name":"type"}],
"methods":[{"name":"setPData","parameterTypes":["long"] }]
},
{
"name":"java.awt.Font",
"fields":[{"name":"name"}, {"name":"pData"}, {"name":"size"}, {"name":"style"}],
"methods":[{"name":"getFont","parameterTypes":["java.lang.String"] }, {"name":"getFontPeer","parameterTypes":[] }]
},
{
"name":"java.awt.Frame",
"fields":[{"name":"undecorated"}]
},
{
"name":"java.awt.Insets",
"fields":[{"name":"bottom"}, {"name":"left"}, {"name":"right"}, {"name":"top"}],
"methods":[{"name":"<init>","parameterTypes":["int","int","int","int"] }]
},
{
"name":"java.awt.Menu",
"methods":[{"name":"countItemsImpl","parameterTypes":[] }, {"name":"getItemImpl","parameterTypes":["int"] }]
},
{
"name":"java.awt.MenuItem",
"fields":[{"name":"enabled"}, {"name":"label"}]
},
{
"name":"java.awt.Point",
"fields":[{"name":"x"}, {"name":"y"}]
},
{
"name":"java.awt.Rectangle",
"methods":[{"name":"<init>","parameterTypes":["int","int","int","int"] }]
},
{
"name":"java.awt.Toolkit",
"methods":[{"name":"getDefaultToolkit","parameterTypes":[] }, {"name":"getFontMetrics","parameterTypes":["java.awt.Font"] }]
},
{
"name":"java.awt.TrayIcon",
"fields":[{"name":"actionCommand"}, {"name":"id"}]
},
{
"name":"java.awt.Window",
"fields":[{"name":"autoRequestFocus"}, {"name":"locationByPlatform"}, {"name":"securityWarningHeight"}, {"name":"securityWarningWidth"}, {"name":"warningString"}],
"methods":[{"name":"calculateSecurityWarningPosition","parameterTypes":["double","double","double","double"] }, {"name":"getWarningString","parameterTypes":[] }]
},
{
"name":"java.awt.Window$Type"
},
{
"name":"java.awt.desktop.UserSessionEvent$Reason",
"fields":[{"name":"CONSOLE"}, {"name":"LOCK"}, {"name":"REMOTE"}, {"name":"UNSPECIFIED"}]
},
{
"name":"java.awt.event.ComponentEvent",
"methods":[{"name":"<init>","parameterTypes":["java.awt.Component","int"] }]
},
{
"name":"java.awt.event.InputEvent",
"fields":[{"name":"modifiers"}],
"methods":[{"name":"getButtonDownMasks","parameterTypes":[] }]
},
{
"name":"java.awt.event.MouseEvent",
"fields":[{"name":"button"}, {"name":"causedByTouchEvent"}, {"name":"x"}, {"name":"y"}],
"methods":[{"name":"<init>","parameterTypes":["java.awt.Component","int","long","int","int","int","int","int","int","boolean","int"] }]
},
{
"name":"java.awt.geom.AffineTransform",
"fields":[{"name":"m00"}, {"name":"m01"}, {"name":"m02"}, {"name":"m10"}, {"name":"m11"}, {"name":"m12"}]
},
{
"name":"java.awt.geom.GeneralPath",
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"<init>","parameterTypes":["int","byte[]","int","float[]","int"] }]
},
{
"name":"java.awt.geom.Path2D",
"fields":[{"name":"numTypes"}, {"name":"pointTypes"}, {"name":"windingRule"}]
},
{
"name":"java.awt.geom.Path2D$Float",
"fields":[{"name":"floatCoords"}]
},
{
"name":"java.awt.geom.Point2D$Float",
"fields":[{"name":"x"}, {"name":"y"}],
"methods":[{"name":"<init>","parameterTypes":["float","float"] }]
},
{
"name":"java.awt.geom.Rectangle2D$Float",
"fields":[{"name":"height"}, {"name":"width"}, {"name":"x"}, {"name":"y"}],
"methods":[{"name":"<init>","parameterTypes":[] }, {"name":"<init>","parameterTypes":["float","float","float","float"] }]
},
{
"name":"java.awt.image.BufferedImage",
"fields":[{"name":"colorModel"}, {"name":"imageType"}, {"name":"raster"}],
"methods":[{"name":"getRGB","parameterTypes":["int","int","int","int","int[]","int","int"] }, {"name":"setRGB","parameterTypes":["int","int","int","int","int[]","int","int"] }]
},
{
"name":"java.awt.image.ColorModel",
"fields":[{"name":"colorSpace"}, {"name":"colorSpaceType"}, {"name":"isAlphaPremultiplied"}, {"name":"is_sRGB"}, {"name":"nBits"}, {"name":"numComponents"}, {"name":"supportsAlpha"}, {"name":"transparency"}],
"methods":[{"name":"getRGBdefault","parameterTypes":[] }]
},
{
"name":"java.awt.image.DirectColorModel",
"methods":[{"name":"<init>","parameterTypes":["int","int","int","int"] }]
},
{
"name":"java.awt.image.IndexColorModel",
"fields":[{"name":"allgrayopaque"}, {"name":"colorData"}, {"name":"lookupcache"}, {"name":"map_size"}, {"name":"rgb"}, {"name":"transparent_index"}]
},
{
"name":"java.awt.image.Raster",
"fields":[{"name":"dataBuffer"}, {"name":"height"}, {"name":"minX"}, {"name":"minY"}, {"name":"numBands"}, {"name":"numDataElements"}, {"name":"sampleModel"}, {"name":"sampleModelTranslateX"}, {"name":"sampleModelTranslateY"}, {"name":"width"}]
},
{
"name":"java.awt.image.SampleModel",
"fields":[{"name":"height"}, {"name":"width"}],
"methods":[{"name":"getPixels","parameterTypes":["int","int","int","int","int[]","java.awt.image.DataBuffer"] }, {"name":"setPixels","parameterTypes":["int","int","int","int","int[]","java.awt.image.DataBuffer"] }]
},
{
"name":"java.awt.image.SinglePixelPackedSampleModel",
"fields":[{"name":"bitMasks"}, {"name":"bitOffsets"}, {"name":"bitSizes"}, {"name":"maxBitSize"}]
},
{
"name":"java.lang.Enum",
"methods":[{"name":"name","parameterTypes":[] }]
},
{
"name":"java.lang.Thread",
"methods":[{"name":"currentThread","parameterTypes":[] }]
},
{
"name":"sun.awt.AWTAutoShutdown",
"methods":[{"name":"notifyToolkitThreadBusy","parameterTypes":[] }, {"name":"notifyToolkitThreadFree","parameterTypes":[] }]
},
{
"name":"sun.awt.EmbeddedFrame"
},
{
"name":"sun.awt.ExtendedKeyCodes",
"methods":[{"name":"getExtendedKeyCodeForChar","parameterTypes":["int"] }]
},
{
"name":"sun.awt.FontDescriptor",
"fields":[{"name":"nativeName"}, {"name":"useUnicode"}]
},
{
"name":"sun.awt.LightweightFrame"
},
{
"name":"sun.awt.PlatformFont",
"fields":[{"name":"componentFonts"}, {"name":"fontConfig"}],
"methods":[{"name":"makeConvertedMultiFontString","parameterTypes":["java.lang.String"] }]
},
{
"name":"sun.awt.SunHints",
"fields":[{"name":"INTVAL_STROKE_PURE"}]
},
{
"name":"sun.awt.SunToolkit",
"methods":[{"name":"isTouchKeyboardAutoShowEnabled","parameterTypes":[] }]
},
{
"name":"sun.awt.Win32GraphicsConfig",
"fields":[{"name":"visual"}]
},
{
"name":"sun.awt.Win32GraphicsDevice",
"fields":[{"name":"dynamicColorModel"}]
},
{
"name":"sun.awt.Win32GraphicsEnvironment",
"methods":[{"name":"dwmCompositionChanged","parameterTypes":["boolean"] }]
},
{
"name":"sun.awt.im.InputMethodWindow"
},
{
"name":"sun.awt.image.BufImgSurfaceData$ICMColorData",
"fields":[{"name":"pData"}],
"methods":[{"name":"<init>","parameterTypes":["long"] }]
},
{
"name":"sun.awt.image.ImageRepresentation",
"fields":[{"name":"numSrcLUT"}, {"name":"srcLUTtransIndex"}]
},
{
"name":"sun.awt.image.IntegerComponentRaster",
"fields":[{"name":"data"}, {"name":"dataOffsets"}, {"name":"pixelStride"}, {"name":"scanlineStride"}, {"name":"type"}]
},
{
"name":"sun.awt.image.SunVolatileImage",
"fields":[{"name":"volSurfaceManager"}]
},
{
"name":"sun.awt.image.VolatileSurfaceManager",
"fields":[{"name":"sdCurrent"}]
},
{
"name":"sun.awt.windows.WComponentPeer",
"fields":[{"name":"hwnd"}, {"name":"winGraphicsConfig"}],
"methods":[{"name":"disposeLater","parameterTypes":[] }, {"name":"postEvent","parameterTypes":["java.awt.AWTEvent"] }, {"name":"replaceSurfaceData","parameterTypes":[] }, {"name":"replaceSurfaceDataLater","parameterTypes":[] }]
},
{
"name":"sun.awt.windows.WDesktopPeer",
"methods":[{"name":"systemSleepCallback","parameterTypes":["boolean"] }, {"name":"userSessionCallback","parameterTypes":["boolean","java.awt.desktop.UserSessionEvent$Reason"] }]
},
{
"name":"sun.awt.windows.WFontPeer",
"fields":[{"name":"textComponentFontName"}]
},
{
"name":"sun.awt.windows.WFramePeer",
"methods":[{"name":"getExtendedState","parameterTypes":[] }]
},
{
"name":"sun.awt.windows.WObjectPeer",
"fields":[{"name":"createError"}, {"name":"destroyed"}, {"name":"pData"}, {"name":"target"}],
"methods":[{"name":"getPeerForTarget","parameterTypes":["java.lang.Object"] }]
},
{
"name":"sun.awt.windows.WPanelPeer",
"fields":[{"name":"insets_"}]
},
{
"name":"sun.awt.windows.WToolkit",
"methods":[{"name":"displayChanged","parameterTypes":[] }, {"name":"paletteChanged","parameterTypes":[] }, {"name":"windowsSettingChange","parameterTypes":[] }]
},
{
"name":"sun.awt.windows.WTrayIconPeer",
"methods":[{"name":"postEvent","parameterTypes":["java.awt.AWTEvent"] }, {"name":"updateImage","parameterTypes":[] }]
},
{
"name":"sun.awt.windows.WWindowPeer",
"fields":[{"name":"windowType"}],
"methods":[{"name":"draggedToNewScreen","parameterTypes":[] }, {"name":"notifyWindowStateChanged","parameterTypes":["int","int"] }]
},
{
"name":"sun.font.CharToGlyphMapper",
"methods":[{"name":"charToGlyph","parameterTypes":["int"] }]
},
{
"name":"sun.font.Font2D",
"methods":[{"name":"canDisplay","parameterTypes":["char"] }, {"name":"charToGlyph","parameterTypes":["int"] }, {"name":"charToVariationGlyph","parameterTypes":["int","int"] }, {"name":"getMapper","parameterTypes":[] }, {"name":"getTableBytes","parameterTypes":["int"] }]
},
{
"name":"sun.font.FontStrike",
"methods":[{"name":"getGlyphMetrics","parameterTypes":["int"] }]
},
{
"name":"sun.font.GlyphList",
"fields":[{"name":"gposx"}, {"name":"gposy"}, {"name":"images"}, {"name":"lcdRGBOrder"}, {"name":"lcdSubPixPos"}, {"name":"len"}, {"name":"positions"}, {"name":"usePositions"}]
},
{
"name":"sun.font.PhysicalStrike",
"fields":[{"name":"pScalerContext"}],
"methods":[{"name":"adjustPoint","parameterTypes":["java.awt.geom.Point2D$Float"] }, {"name":"getGlyphPoint","parameterTypes":["int","int"] }]
},
{
"name":"sun.font.StrikeMetrics",
"methods":[{"name":"<init>","parameterTypes":["float","float","float","float","float","float","float","float","float","float"] }]
},
{
"name":"sun.font.TrueTypeFont",
"methods":[{"name":"readBlock","parameterTypes":["java.nio.ByteBuffer","int","int"] }, {"name":"readBytes","parameterTypes":["int","int"] }]
},
{
"name":"sun.font.Type1Font",
"methods":[{"name":"readFile","parameterTypes":["java.nio.ByteBuffer"] }]
},
{
"name":"sun.java2d.Disposer",
"methods":[{"name":"addRecord","parameterTypes":["java.lang.Object","long","long"] }]
},
{
"name":"sun.java2d.InvalidPipeException"
},
{
"name":"sun.java2d.NullSurfaceData"
},
{
"name":"sun.java2d.SunGraphics2D",
"fields":[{"name":"clipRegion"}, {"name":"composite"}, {"name":"eargb"}, {"name":"lcdTextContrast"}, {"name":"pixel"}, {"name":"strokeHint"}]
},
{
"name":"sun.java2d.SurfaceData",
"fields":[{"name":"pData"}, {"name":"valid"}]
},
{
"name":"sun.java2d.loops.Blit",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.BlitBg",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.CompositeType",
"fields":[{"name":"AnyAlpha"}, {"name":"Src"}, {"name":"SrcNoEa"}, {"name":"SrcOver"}, {"name":"SrcOverNoEa"}, {"name":"Xor"}]
},
{
"name":"sun.java2d.loops.DrawGlyphList",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawGlyphListAA",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawGlyphListLCD",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawLine",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawParallelogram",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawPath",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawPolygons",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.DrawRect",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.FillParallelogram",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.FillPath",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.FillRect",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.FillSpans",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.GraphicsPrimitive",
"fields":[{"name":"pNativePrim"}]
},
{
"name":"sun.java2d.loops.GraphicsPrimitiveMgr",
"methods":[{"name":"register","parameterTypes":["sun.java2d.loops.GraphicsPrimitive[]"] }]
},
{
"name":"sun.java2d.loops.MaskBlit",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.MaskFill",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.ScaledBlit",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.SurfaceType",
"fields":[{"name":"Any3Byte"}, {"name":"Any4Byte"}, {"name":"AnyByte"}, {"name":"AnyColor"}, {"name":"AnyInt"}, {"name":"AnyShort"}, {"name":"ByteBinary1Bit"}, {"name":"ByteBinary2Bit"}, {"name":"ByteBinary4Bit"}, {"name":"ByteGray"}, {"name":"ByteIndexed"}, {"name":"ByteIndexedBm"}, {"name":"FourByteAbgr"}, {"name":"FourByteAbgrPre"}, {"name":"Index12Gray"}, {"name":"Index8Gray"}, {"name":"IntArgb"}, {"name":"IntArgbBm"}, {"name":"IntArgbPre"}, {"name":"IntBgr"}, {"name":"IntRgb"}, {"name":"IntRgbx"}, {"name":"OpaqueColor"}, {"name":"ThreeByteBgr"}, {"name":"Ushort4444Argb"}, {"name":"Ushort555Rgb"}, {"name":"Ushort555Rgbx"}, {"name":"Ushort565Rgb"}, {"name":"UshortGray"}, {"name":"UshortIndexed"}]
},
{
"name":"sun.java2d.loops.TransformHelper",
"methods":[{"name":"<init>","parameterTypes":["long","sun.java2d.loops.SurfaceType","sun.java2d.loops.CompositeType","sun.java2d.loops.SurfaceType"] }]
},
{
"name":"sun.java2d.loops.XORComposite",
"fields":[{"name":"alphaMask"}, {"name":"xorColor"}, {"name":"xorPixel"}]
},
{
"name":"sun.java2d.pipe.Region",
"fields":[{"name":"bands"}, {"name":"endIndex"}, {"name":"hix"}, {"name":"hiy"}, {"name":"lox"}, {"name":"loy"}]
},
{
"name":"sun.java2d.pipe.RegionIterator",
"fields":[{"name":"curIndex"}, {"name":"numXbands"}, {"name":"region"}]
},
{
"name":"sun.java2d.windows.WindowsFlags",
"fields":[{"name":"d3dEnabled"}, {"name":"d3dSet"}, {"name":"offscreenSharingEnabled"}, {"name":"setHighDPIAware"}]
}
]
I tested again with Oracle GraalVM for JDK21 release and it was working fine. please give it a try from here https://www.graalvm.org/downloads/
Closing this as not-reproducible
@pquiring have you succeed with graalvm for java 21? I have some troubles even with making it work :)
No progress.
java.awt.PopupMenu are not rendered correctly. They are often squished (not enough room for text) or sometimes the wrong font.
Sample code:
Build steps: Make a small tray.png file (16x16) Compile:
javac trayicon.java
Agent:java -agentlib:native-image-agent=config-output-dir=META-INF\native-image trayicon
archive:jar -cf trayicon.jar *.class META-INF\native-image\*
NativeImage :native-image -cp trayicon.jar trayicon
Run:trayicon.exe
Environment: Latest graal 23.1.0 CE (must be latest nightly build. 23.0 the tray icon doesn't work at all) Windows 11 amd64
Thanks,