diff --git a/quarkus-usb4java/deployment/src/main/java/io/quarkus/awt/deployment/AwtProcessor.java b/quarkus-usb4java/deployment/src/main/java/io/quarkus/awt/deployment/AwtProcessor.java index 8934650ff..a7463c139 100644 --- a/quarkus-usb4java/deployment/src/main/java/io/quarkus/awt/deployment/AwtProcessor.java +++ b/quarkus-usb4java/deployment/src/main/java/io/quarkus/awt/deployment/AwtProcessor.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.stream.Stream; -import io.quarkus.awt.runtime.graal.AwtFeature; import io.quarkus.awt.runtime.graal.DarwinAwtFeature; import io.quarkus.awt.runtime.graal.WindowsAwtFeature; import io.quarkus.deployment.Feature; @@ -38,13 +37,14 @@ void nativeImageFeatures(BuildProducer nativeImageF nativeImageFeatures.produce(new NativeImageFeatureBuildItem(WindowsAwtFeature.class)); } - // k: comment to allow Win - // @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) - // UnsupportedOSBuildItem osSupportCheck() { - // return new UnsupportedOSBuildItem(WINDOWS, - // "Windows AWT integration is not ready in native-image and would result in " + - // "java.lang.UnsatisfiedLinkError: no awt in java.library.path."); - // } + /* k: bloc commented to allow Win + @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + UnsupportedOSBuildItem osSupportCheck() { + return new UnsupportedOSBuildItem(WINDOWS, + "Windows AWT integration is not ready in native-image and would result in " + + "java.lang.UnsatisfiedLinkError: no awt in java.library.path."); + } + */ @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) NativeMinimalJavaVersionBuildItem nativeMinimalJavaVersionBuildItem() { @@ -126,120 +126,7 @@ void setupAWTInit(BuildProducer jc, /* @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) JniRuntimeAccessBuildItem setupJava2DClasses() { - return new JniRuntimeAccessBuildItem(true, true, true, - "com.sun.imageio.plugins.jpeg.JPEGImageReader", - "com.sun.imageio.plugins.jpeg.JPEGImageWriter", - "java.awt.AlphaComposite", - "java.awt.Color", - "java.awt.color.CMMException", - "java.awt.color.ColorSpace", - "java.awt.color.ICC_Profile", - "java.awt.color.ICC_ProfileGray", - "java.awt.color.ICC_ProfileRGB", - "java.awt.geom.AffineTransform", - "java.awt.geom.GeneralPath", - "java.awt.geom.Path2D", - "java.awt.geom.Path2D$Float", - "java.awt.geom.Point2D$Float", - "java.awt.geom.Rectangle2D$Float", - "java.awt.image.AffineTransformOp", - "java.awt.image.BandedSampleModel", - "java.awt.image.BufferedImage", - "java.awt.image.ColorModel", - "java.awt.image.ComponentColorModel", - "java.awt.image.ComponentSampleModel", - "java.awt.image.ConvolveOp", - "java.awt.image.DirectColorModel", - "java.awt.image.IndexColorModel", - "java.awt.image.Kernel", - "java.awt.image.MultiPixelPackedSampleModel", - "java.awt.image.PackedColorModel", - "java.awt.image.PixelInterleavedSampleModel", - "java.awt.image.Raster", - "java.awt.image.SampleModel", - "java.awt.image.SinglePixelPackedSampleModel", - "java.awt.Transparency", - "javax.imageio.IIOException", - "javax.imageio.plugins.jpeg.JPEGHuffmanTable", - "javax.imageio.plugins.jpeg.JPEGQTable", - "sun.awt.image.BufImgSurfaceData", - "sun.awt.image.BufImgSurfaceData$ICMColorData", - "sun.awt.image.ByteBandedRaster", - "sun.awt.image.ByteComponentRaster", - "sun.awt.image.ByteInterleavedRaster", - "sun.awt.image.BytePackedRaster", - "sun.awt.image.DataBufferNative", - "sun.awt.image.GifImageDecoder", - "sun.awt.image.ImageRepresentation", - "sun.awt.image.ImagingLib", - "sun.awt.image.IntegerComponentRaster", - "sun.awt.image.IntegerInterleavedRaster", - "sun.awt.image.ShortBandedRaster", - "sun.awt.image.ShortComponentRaster", - "sun.awt.image.ShortInterleavedRaster", - "sun.awt.image.SunWritableRaster", - "sun.awt.image.WritableRasterNative", - "sun.awt.SunHints", - "sun.font.CharToGlyphMapper", - "sun.font.Font2D", - "sun.font.FontConfigManager", - "sun.font.FontManagerNativeLibrary", - "sun.font.FontStrike", - // Added for JDK 19+ due to: https://github.com/openjdk/jdk20/commit/9bc023220 calling FontUtilities - "sun.font.FontUtilities", - "sun.font.FreetypeFontScaler", - "sun.font.GlyphLayout", - "sun.font.GlyphLayout$EngineRecord", - "sun.font.GlyphLayout$GVData", - "sun.font.GlyphLayout$LayoutEngine", - "sun.font.GlyphLayout$LayoutEngineFactory", - "sun.font.GlyphLayout$LayoutEngineKey", - "sun.font.GlyphLayout$SDCache", - "sun.font.GlyphLayout$SDCache$SDKey", - "sun.font.GlyphList", - "sun.font.PhysicalStrike", - "sun.font.StrikeMetrics", - "sun.font.TrueTypeFont", - "sun.font.Type1Font", - "sun.java2d.cmm.lcms.LCMSImageLayout", - "sun.java2d.cmm.lcms.LCMSProfile", - "sun.java2d.cmm.lcms.LCMSTransform", - "sun.java2d.DefaultDisposerRecord", - "sun.java2d.Disposer", - "sun.java2d.InvalidPipeException", - "sun.java2d.loops.Blit", - "sun.java2d.loops.BlitBg", - "sun.java2d.loops.CompositeType", - "sun.java2d.loops.DrawGlyphList", - "sun.java2d.loops.DrawGlyphListAA", - "sun.java2d.loops.DrawGlyphListLCD", - "sun.java2d.loops.DrawLine", - "sun.java2d.loops.DrawParallelogram", - "sun.java2d.loops.DrawPath", - "sun.java2d.loops.DrawPolygons", - "sun.java2d.loops.DrawRect", - "sun.java2d.loops.FillParallelogram", - "sun.java2d.loops.FillPath", - "sun.java2d.loops.FillRect", - "sun.java2d.loops.FillSpans", - "sun.java2d.loops.GraphicsPrimitive", - "sun.java2d.loops.GraphicsPrimitiveMgr", - "sun.java2d.loops.MaskBlit", - "sun.java2d.loops.MaskFill", - "sun.java2d.loops.ScaledBlit", - "sun.java2d.loops.SurfaceType", - "sun.java2d.loops.TransformHelper", - "sun.java2d.loops.XORComposite", - "sun.java2d.NullSurfaceData", - "sun.java2d.pipe.BufferedMaskBlit", - "sun.java2d.pipe.GlyphListPipe", - "sun.java2d.pipe.Region", - "sun.java2d.pipe.RegionIterator", - "sun.java2d.pipe.ShapeSpanIterator", - "sun.java2d.pipe.SpanClipRenderer", - "sun.java2d.pipe.ValidatePipe", - "sun.java2d.SunGraphics2D", - "sun.java2d.SurfaceData", + return new JniRuntimeAccessBuildItem(true, true, tru // Java 20 :test "javax.imageio.ImageIO", "javax.imageio.spi.ImageReaderSpi", diff --git a/quarkus-usb4java/runtime/src/main/java/io/quarkus/awt/runtime/graal/AwtFeature.java b/quarkus-usb4java/runtime/src/main/java/io/quarkus/awt/runtime/graal/AwtFeature.java deleted file mode 100644 index dcad04932..000000000 --- a/quarkus-usb4java/runtime/src/main/java/io/quarkus/awt/runtime/graal/AwtFeature.java +++ /dev/null @@ -1,23 +0,0 @@ -package io.quarkus.awt.runtime.graal; - -import org.graalvm.nativeimage.hosted.RuntimeClassInitialization; -import org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess; - -/** - * Note that this initialization is not enough if user wants to deserialize actual images - * (e.g. from XML). AWT Extension must be loaded for decoding JDK supported image formats. - */ -@Deprecated -public class AwtFeature { //implements Feature { - //@Override - public void afterRegistration(AfterRegistrationAccess access) { - // Quarkus run time init for AWT - RuntimeClassInitialization.initializeAtRunTime( - "com.sun.imageio", - "java.awt", - "javax.imageio", - "sun.awt", - "sun.font", - "sun.java2d"); - } -} \ No newline at end of file