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

Is there any GraalVM native-image support availabe? #218

Open
ctoabidmaqbool opened this issue Aug 18, 2024 · 4 comments
Open

Is there any GraalVM native-image support availabe? #218

ctoabidmaqbool opened this issue Aug 18, 2024 · 4 comments

Comments

@ctoabidmaqbool
Copy link

Hi all! It looks like instrusting project!

Can this project be secessfully work on GraalVM native-image project!

Actually I am instrusted in using JavaFx and want to put put my app on System Tray icon (Windows currently). Also there is a new Java technology called GraalVM and it have a nice feature Native Image.

I am wondring if it's can be used in Graalvm native-image.

Note: GraalVM native-image does't support 100% AWT/Swing apps!

@ctoabidmaqbool
Copy link
Author

Native compiling, and link is done secessfully!

gradlew :SystemTray:clean :SystemTray:nativeBuild

process-compile-1723996447710.log
process-link-1723996449634.log
client-debug0.log
client-debug0.log.1.txt

After native building I try to native run but still errors e.g. Caused by: java.lang.UnsatisfiedLinkError: no awt in java.library.path:

gradlew :SystemTray:nativeRun

client-debug0.log.2.txt

I manuely copy these libs to folder D:\JavaFx-Android\gluon-samples-gradle\SystemTray\build\gluonfx\x86_64-windows
awt.dll, fontmanager.dll, freetype.dll, java.dll, jvm.dll

but still error:

client-debug0.log.3.txt

Note: before running native compile I also run gradlew :SystemTray:nativeRunAgent

Simple gradlew :SystemTray:run and gradlew :SystemTray:nativeRunAgent works correctly!

@ctoabidmaqbool
Copy link
Author

There are couple of issues alrady.
gluonhq/gluonfx-maven-plugin#505
oracle/graal#8273
oracle/graal#3084

@ctoabidmaqbool
Copy link
Author

Last error I am facing Caused by: java.lang.Error: java.home property not set:

[Mon Aug 19 09:36:33 PKT 2024][INFO] ==================== RUN TASK ====================
[Mon Aug 19 09:36:33 PKT 2024][FINE] PB Command for run until end: D:\JavaFx-Android\gluon-samples-gradle\SystemTray\build\gluonfx\x86_64-windows\SystemTray.exe
[Mon Aug 19 09:36:33 PKT 2024][FINE] Start process run until end...
[Mon Aug 19 09:36:33 PKT 2024][INFO] [SUB] Aug 19, 2024 9:36:33 AM com.sun.javafx.application.PlatformImpl startup
[Mon Aug 19 09:36:33 PKT 2024][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @41b13f3d'
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] Aug 19, 2024 9:36:34 AM dorkbox.systemTray.SystemTray get
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] SEVERE: Unable to create tray type: '_WindowsNativeTray'
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] java.lang.reflect.InvocationTargetException
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.systemTray.SystemTray.get(SystemTray.java:799)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.TestTrayJavaFX.doJavaFxStuff(TestTrayJavaFX.java:119)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.TestTrayJavaFX$MyApplication.start(TestTrayJavaFX.java:74)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:128)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:400)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.runWith(Thread.java:1583)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.run(Thread.java:1570)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] Caused by: java.lang.Error: java.home property not set
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.FontConfiguration.findFontConfigFile(FontConfiguration.java:180)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.FontConfiguration.<init>(FontConfiguration.java:97)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.windows.WFontConfiguration.<init>(WFontConfiguration.java:41)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.Win32FontManager.createFontConfiguration(Win32FontManager.java:175)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager$2.run(SunFontManager.java:352)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager$2.run(SunFontManager.java:309)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:128)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:319)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.SunFontManager.<init>(SunFontManager.java:309)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.awt.Win32FontManager.<init>(Win32FontManager.java:83)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.PlatformFontInfo.createFontManager(PlatformFontInfo.java:37)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:51)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.awt.Font.getFont2D(Font.java:526)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.awt.Font$FontAccessImpl.getFont2D(Font.java:265)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.FontUtilities.getFont2D(FontUtilities.java:151)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1110)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1099)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/sun.font.StandardGlyphVector.<init>(StandardGlyphVector.java:163)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at [email protected]/java.awt.Font.createGlyphVector(Font.java:2745)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.util.FontUtil.getFontHeight(FontUtil.kt:162)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.systemTray.ui.swing.SwingMenuItemCheckbox.createCheckedIcon(SwingMenuItemCheckbox.java:57)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	at dorkbox.systemTray.ui.swing._WindowsNativeTray.<init>(_WindowsNativeTray.java:88)
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 	... 18 more
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] 
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] Exception in Application start method
[Mon Aug 19 09:36:34 PKT 2024][INFO] [SUB] Exception in Application stop method
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.runWith(Thread.java:1583)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at [email protected]/java.lang.Thread.run(Thread.java:1570)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] Caused by: java.lang.RuntimeException: Unable to load SystemTray!
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at dorkbox.TestTrayJavaFX.doJavaFxStuff(TestTrayJavaFX.java:121)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at dorkbox.TestTrayJavaFX$MyApplication.start(TestTrayJavaFX.java:74)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.executePrivileged(AccessController.java:128)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:400)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
[Mon Aug 19 09:36:35 PKT 2024][INFO] [SUB] 	... 4 more
[Mon Aug 19 09:36:35 PKT 2024][FINE] Result for run until end: 0

@ctoabidmaqbool
Copy link
Author

oracle/graal#4344

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

1 participant