Skip to content
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

Any posibilities to use libraries which are also using AWT / Swing with GraalVM native-image feature? #505

Open
ctoabidmaqbool1 opened this issue Apr 22, 2024 · 15 comments

Comments

@ctoabidmaqbool1
Copy link

Hi! currently GraalVM is not currently supported AWT.

Actualy I am trying to use power libs e.g. ICE-Pdf Viewer and iText pdf 5.

I think there are some solutions to AWT with GraalVM e.g. https://bell-sw.com/liberica-native-image-kit/

But i am not sure, if can i use it with Gluon technology!

https://bell-sw.com/blog/how-to-turn-awt-applications-into-native-images/

I have put issue to library officail repository too!

pcorless/icepdf#351

@ctoabidmaqbool1
Copy link
Author

Here there there is a similar issue already: gluonhq/substrate#908

@Hugolarson
Copy link

Just copy those file to folder where your exe is launched and it should work with AWT

@ctoabidmaqbool1
Copy link
Author

ctoabidmaqbool1 commented Apr 23, 2024

@Hugolarson Thanks for your quick response and solution.

I am not sure which should I have to copy and put where exe is launched, please try to explain you comment!

Here is my sample working project: https://github.com/ctoabidmaqbool1/iTextPdf-5-And-ICEpdf-Viewer-Test/tree/gluon-or-graalvm-issue

And as I already mentioned, my other issues at: pcorless/icepdf#351 (comment)

image

@Hugolarson
Copy link

Copy AWT related DLLs from JVM to exe folder.
java.dll
jvm.dll
awt.dll

@ctoabidmaqbool1
Copy link
Author

I have copies those files from my D:\Programs\graalvm-svm-java17-windows-gluon-22.1.0.1-Final\bin and now some more errors are comming!

image

[Tue Apr 23 15:48:10 PKT 2024][INFO] ==================== RUN TASK ====================

[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] Apr 23, 2024 3:48:15 PM org.icepdf.core.pobjects.Catalog <clinit>
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] INFO: ICEpdf Core 7.2.0
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] Exception in thread "JavaFX Application Thread" java.lang.InternalError: java.lang.reflect.InvocationTargetException
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:87)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.executePrivileged(AccessController.java:169)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.doPrivileged(AccessController.java:318)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.SunFontManager.getInstance(SunFontManager.java:248)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:266)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1242)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComponent.getFontMetrics(JComponent.java:1691)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicLabelUI.getPreferredSize(BasicLabelUI.java:251)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComponent.getPreferredSize(JComponent.java:1725)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicComboBoxRenderer.getPreferredSize(BasicComboBoxRenderer.java:89)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1446)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1394)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2815)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:224)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:204)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:251)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:448)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:458)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:502)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JList.setSelectedIndex(JList.java:2232)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicComboPopup.setListSelection(BasicComboPopup.java:1273)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(BasicComboPopup.java:1097)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1257)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1318)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComboBox.contentsChanged(JComboBox.java:1365)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:127)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:94)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:132)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javax.swing.JComboBox.addItem(JComboBox.java:746)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildZoomCombBox(SwingViewBuilder.java:1466)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildZoomToolBar(SwingViewBuilder.java:1438)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildCompleteToolBar(SwingViewBuilder.java:1217)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:485)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:472)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.gluonapplication.GluonApplication.openPdfInViewer(GluonApplication.java:125)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.gluonapplication.GluonApplication.lambda$start$0(GluonApplication.java:38)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.event.Event.fireEvent(Event.java:198)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.scene.Node.fireEvent(Node.java:8935)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.scene.control.Button.fire(Button.java:203)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.event.Event.fireEvent(Event.java:198)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene.processMouseEvent(Scene.java:1890)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.executePrivileged(AccessController.java:169)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.doPrivileged(AccessController.java:399)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.View.notifyMouse(View.java:937)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST_View_notifyMouse_4f1a8388c3763e6ef91b5795c9a3bb669af40a28(JNIJavaCallWrappers.java:0)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication._runLoop(WinApplication.java)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.lang.Thread.run(Thread.java:833)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] Caused by: java.lang.reflect.InvocationTargetException
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:85)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	... 85 more
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] Caused by: java.lang.Error: java.home property not set
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.awt.FontConfiguration.findFontConfigFile(FontConfiguration.java:181)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.awt.FontConfiguration.<init>(FontConfiguration.java:98)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.awt.windows.WFontConfiguration.<init>(WFontConfiguration.java:41)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.awt.Win32FontManager.createFontConfiguration(Win32FontManager.java:180)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.SunFontManager$2.run(SunFontManager.java:358)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.SunFontManager$2.run(SunFontManager.java:315)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.executePrivileged(AccessController.java:169)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at java.security.AccessController.doPrivileged(AccessController.java:318)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.font.SunFontManager.<init>(SunFontManager.java:315)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	at sun.awt.Win32FontManager.<init>(Win32FontManager.java:88)
[Tue Apr 23 15:48:15 PKT 2024][INFO] [SUB] 	... 88 more

Alos it looks like, after applying something like this, It's using gernal Java not graalvm-native image only?

@Hugolarson
Copy link

Maybe id does not work with swing. My application is Javafx and AWT and it's working

@ctoabidmaqbool1
Copy link
Author

ctoabidmaqbool1 commented Apr 23, 2024

In my another project When I try to run any native tasks, e.g. ./gradlew nativeRunAgent, ./gradlew nativeCompile

I am trying my commands in Windows 10 -> WSL 2 -> Ubuntu

java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment GraalVM 22.1.0.1 (build 17.0.3+7-jvmci-22.1-b06)
OpenJDK 64-Bit Server VM GraalVM 22.1.0.1 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing)
wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.4291
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

I am seeing error e.g.:

$ ./gradlew :MyApp:nativeRunAgent
Begin event threw error
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Color
        at net.sf.jasperreports.engine.util.JRColorUtil.getColor(JRColorUtil.java:90)
        at net.sf.jasperreports.engine.xml.JRAbstractStyleFactory.setCommonStyle(JRAbstractStyleFactory.java:97)
        at net.sf.jasperreports.engine.xml.JRAbstractStyleFactory.createObject(JRAbstractStyleFactory.java:76)
        at org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:397)
        at org.apache.commons.digester.Digester.startElement(Digester.java:1583)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
        at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:833)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
        at org.apache.commons.digester.Digester.parse(Digester.java:1892)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:299)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:286)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:275)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:220)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:195)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:186)
        at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:254)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:555)
        at net.sf.jasperreports.engine.JasperCompileManager$compileReportToFile$1.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
        at com.github.gmazelier.tasks.JasperReportsCompile$_execute_closure5$_closure8.doCall(JasperReportsCompile.groovy:69)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:428)
        at groovyx.gpars.pa.CallClosure.call(CallClosure.java:47)
        at groovyx.gpars.pa.ClosureMapper.op(ClosureMapper.java:36)
        at groovyx.gpars.extra166y.AbstractParallelAnyArray$OOMPap.leafTransfer(AbstractParallelAnyArray.java:2255)
        at groovyx.gpars.extra166y.PAS$FJOMap.atLeaf(PAS.java:258)
        at groovyx.gpars.extra166y.PAS$FJBase.internalCompute(PAS.java:118)
        at groovyx.gpars.extra166y.PAS$FJBase.compute(PAS.java:106)
        at jsr166y.RecursiveAction.exec(RecursiveAction.java:148)
        at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:305)
        at jsr166y.ForkJoinWorkerThread.execTask(ForkJoinWorkerThread.java:575)
        at jsr166y.ForkJoinPool.scan(ForkJoinPool.java:733)
        at jsr166y.ForkJoinPool.work(ForkJoinPool.java:617)
        at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:369)
Begin event threw error

@ctoabidmaqbool1
Copy link
Author

ctoabidmaqbool1 commented Apr 24, 2024

Okey, Last time erorrs are caused my system missing dependencies.

$ ./gradlew :MyApp:nativeRunAgent
Begin event threw error
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Color
        at net.sf.jasperreports.engine.util.JRColorUtil.getColor(JRColorUtil.java:90)
        at net.sf.jasperreports.engine.xml.JRAbstractStyleFactory.setCommonStyle(JRAbstractStyleFactory.java:97)
        at net.sf.jasperreports.engine.xml.JRAbstractStyleFactory.createObject(JRAbstractStyleFactory.java:76)
        at org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:397)
        at org.apache.commons.digester.Digester.startElement(Digester.java:1583)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:518)
        at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:833)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1224)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:637)
        at org.apache.commons.digester.Digester.parse(Digester.java:1892)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:299)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:286)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:275)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:220)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:195)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:186)
        at net.sf.jasperreports.engine.JasperCompileManager.compileToFile(JasperCompileManager.java:254)
        at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:555)
        at net.sf.jasperreports.engine.JasperCompileManager$compileReportToFile$1.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:148)
        at com.github.gmazelier.tasks.JasperReportsCompile$_execute_closure5$_closure8.doCall(JasperReportsCompile.groovy:69)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
        at groovy.lang.Closure.call(Closure.java:412)
        at groovy.lang.Closure.call(Closure.java:428)
        at groovyx.gpars.pa.CallClosure.call(CallClosure.java:47)
        at groovyx.gpars.pa.ClosureMapper.op(ClosureMapper.java:36)
        at groovyx.gpars.extra166y.AbstractParallelAnyArray$OOMPap.leafTransfer(AbstractParallelAnyArray.java:2255)
        at groovyx.gpars.extra166y.PAS$FJOMap.atLeaf(PAS.java:258)
        at groovyx.gpars.extra166y.PAS$FJBase.internalCompute(PAS.java:118)
        at groovyx.gpars.extra166y.PAS$FJBase.compute(PAS.java:106)
        at jsr166y.RecursiveAction.exec(RecursiveAction.java:148)
        at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:305)
        at jsr166y.ForkJoinWorkerThread.execTask(ForkJoinWorkerThread.java:575)
        at jsr166y.ForkJoinPool.scan(ForkJoinPool.java:733)
        at jsr166y.ForkJoinPool.work(ForkJoinPool.java:617)
        at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:369)
Begin event threw error

I have solved by Complete installing WSL 2 -> Ubuntu with GUI package e.g.

wsl --install

wsl

sudo apt update

sudo apt install libxxf86vm1
sudo apt install libgl1-mesa-dev
sudo apt install libgtk-3-dev
sudo apt-get install gcc

# or simply

sudo apt install build-essential

@ctoabidmaqbool
Copy link

Copy AWT related DLLs from JVM to exe folder. java.dll jvm.dll awt.dll

Hi! your provided solutions works as expacted 100%!

but I have to copy every time i again clean and build gluon native-image.

iss there any method to automatically copy these file and after nativing building or including these libs using gradle or something else???

I am trying currently

gradlew clean build nativeBuild nativeRun

or

mvn clean -Pdesktop gluonfx:build gluonfx:nativerun

@ctoabidmaqbool1
Copy link
Author

There are 100 or thousand of libraries available which are dependent upon AWT and Swing too, So How can we such a libraries with GrallVM nicely!

I am facing such an issue in my another project:
dustinkredmond/FXTrayIcon#88

@ctoabidmaqbool
Copy link

Still errror is shoiwng, java.home property not set

[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] INFO: ICEpdf Core 7.2.0
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] Exception in thread "JavaFX Application Thread" java.lang.Error: java.home property not set
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.FontConfiguration.findFontConfigFile(FontConfiguration.java:180)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.FontConfiguration.<init>(FontConfiguration.java:97)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.windows.WFontConfiguration.<init>(WFontConfiguration.java:41)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.Win32FontManager.createFontConfiguration(Win32FontManager.java:175)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager$2.run(SunFontManager.java:352)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager$2.run(SunFontManager.java:309)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:128)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager.<init>(SunFontManager.java:309)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.Win32FontManager.<init>(Win32FontManager.java:83)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.PlatformFontInfo.createFontManager(PlatformFontInfo.java:37)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:51)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager.getInstance(SunFontManager.java:242)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:260)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1242)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComponent.getFontMetrics(JComponent.java:1700)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicLabelUI.getPreferredSize(BasicLabelUI.java:251)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComponent.getPreferredSize(JComponent.java:1734)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicComboBoxRenderer.getPreferredSize(BasicComboBoxRenderer.java:89)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1446)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1394)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicListUI$Handler.valueChanged(BasicListUI.java:2815)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:231)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:206)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:258)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:459)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:469)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:513)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JList.setSelectedIndex(JList.java:2232)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicComboPopup.setListSelection(BasicComboPopup.java:1281)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.plaf.basic.BasicComboPopup$Handler.itemStateChanged(BasicComboPopup.java:1097)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1257)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1318)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComboBox.contentsChanged(JComboBox.java:1365)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:127)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:94)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:132)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/javax.swing.JComboBox.addItem(JComboBox.java:746)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildZoomCombBox(SwingViewBuilder.java:1466)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildZoomToolBar(SwingViewBuilder.java:1438)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildCompleteToolBar(SwingViewBuilder.java:1217)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildContents(SwingViewBuilder.java:485)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.icepdf.ri.common.SwingViewBuilder.buildViewerPanel(SwingViewBuilder.java:472)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.gluonapplication.GluonApplication.openPdfInViewer(GluonApplication.java:125)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.gluonapplication.GluonApplication.lambda$start$0(GluonApplication.java:38)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.event.Event.fireEvent(Event.java:198)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.scene.Node.fireEvent(Node.java:8935)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.scene.control.Button.fire(Button.java:203)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.event.Event.fireEvent(Event.java:198)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene.processMouseEvent(Scene.java:1890)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:128)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:400)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.View.notifyMouse(View.java:937)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.runWith(Thread.java:1583)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.run(Thread.java:1570)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
[Fri Aug 09 16:22:47 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)

@Hugolarson
Copy link

Try set java.home in terminal your run gradlew
set GRAALVM_HOME=C:\java\graalvm-ce-java17-22.3.3
set JAVA_HOME=C:\java\graalvm-ce-java17-22.3.3

@ctoabidmaqbool
Copy link

I think, this is issue in graalvm too: oracle/graal#1812

@ctoabidmaqbool
Copy link

Try set java.home in terminal your run gradlew set GRAALVM_HOME=C:\java\graalvm-ce-java17-22.3.3 set JAVA_HOME=C:\java\graalvm-ce-java17-22.3.3

I alrady have tried without any luck, e.g. same issue: java.home property not set!

set GRAALVM_HOME=D:\Programs\graalvm-jdk-22_windows-x64_bin
set JAVA_HOME=D:\Programs\graalvm-jdk-22_windows-x64_bin
set java.home=D:\Programs\graalvm-jdk-22_windows-x64_bin
set PATH=%JAVA_HOME%\bin;%PATH%
set GRADLE_USER_HOME=D:\.my-gradle
gradlew clean build nativeBuild nativeRun

Anyhow, still if I will be seccedded, then still it will not be pure graalvm native-image but will be tottaly dependent upon JVM.

@ctoabidmaqbool
Copy link

It's looks like AWT/Swing can be used in GraalVM, but still i am facing same issue, even in latest GraalVM release
oracle/graal#3085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants