#graalvm javafx linux Webview

48 messages · Page 1 of 1 (latest)

winged current
#

I'm having some issues when I compile my application natively on Linux. It works perfectly fine compiling for windows on Linux I'm getting a error and it crashes every time the webview is loaded.

Technologies used
Ubuntu 22.04.4 LTS 64bit
Java 17
JavaFX 21
Gluon 17 + 21
Gradle

Error Message

Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Main
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.sun.javafx.application.PlatformImpl startup
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @71c7db30'
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: Exception in Application start method
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: at java.lang.Thread.run(Thread.java:833)
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] Apr 08, 2024 11:36:22 PM com.graalonline.apps.remotecontrol.FXRunner$1 lambda$flushBuffer$0
[Mon Apr 08 23:36:22 EDT 2024][INFO] [SUB] SEVERE: Caused by: java.lang.UnsatisfiedLinkError: com.sun.webkit.WebPage.twkInitWebCore(ZZZ)V [symbol: Java_com_sun_webkit_WebPage_twkInitWebCore or Java_com_sun_webkit_WebPage_twkInitWebCore__ZZZ]

Gradle File
https://pastebin.com/RULK0mi0

wraith ironBOT
#

This post has been reserved for your question.

Hey @winged current! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

neon pilot
#

With "compiling natively", do you mean native-image?

#

ah yes I see the native-image args

#

You added --static.

#

Static images are not supported with JavaFX or Swing AFAIK

#

Also are you using the classpath or the modulepath for the native-image compilation? Can you show the full command Gradle is exeucting there?

#

Also not sure whether applicationDefaultJvmArgs is the right thing to pass native-image args

#

anyways it sais

java.lang.UnsatisfiedLinkError: com.sun.webkit.WebPage.twkInitWebCore(ZZZ)V [symbol: Java_com_sun_webkit_WebPage_twkInitWebCore or Java_com_sun_webkit_WebPage_twkInitWebCore__ZZZ]
which probably means that that native library is not available

#

which culd be due to --static

winged current
#

interesting will certainly try that, when compiling natively I mean using Gluon (to compile to that native respected platforms binary). However it works as intended right from the IDE.

neon pilot
#

and from the command-line without native-image?

winged current
#

works fine without nativeimage

#

even works when I compile it if I remove the webview

#

Webview seems to be causing the application to crash

#

was thinking if it was my linux environment, since I'm new to linux. Works fine on windows.

neon pilot
#

you are targetting Linux as well, right?

#

not Android or something like that

winged current
#

yea and compiling from Ubuntu 64bit

#

yea Linux not for mobile

#

it's a Game Server Management tool, that uses webview for it's script editor

neon pilot
#

and you ran the executable directly without copying it anywhere?

winged current
#

yes using nativeRun

neon pilot
#

oh so nativeRun directly runs the executable?

winged current
#

which tests the executable in that current location

#

yea

#

(even without native run it crashes), but with nativeRun i geta stacktrace

neon pilot
#

As I said, try not using --static

winged current
#

will also that static is for gluon JavaFX applications

#

The command gluon gradle build --static refers to building a project using the Gluon plugin for Gradle with a specific option to create a static compilation of a JavaFX application. Gluon provides tools and plugins that facilitate the development of JavaFX applications for various platforms, including mobile devices (iOS and Android), embedded systems, and desktops.

neon pilot
winged current
#

but will certainly try it without it, certainly desperate

winged current
#

seen this was posted in 2022 was hoping this wasn't the case

neon pilot
#

--static is a native-image argument for statically linked stuff

neon pilot
winged current
#

ahh great information

neon pilot
#

but I also think I read somewhere that --static is generally not supported (from GraalVM's side) with any UI stuff

neon pilot
#

oh and it's --libc=musl, not --musl

#

that argumewould make it use musl instead of libc

neon pilot
winged current
#

that might be some helpful information "I had WebView/WebEngine working under slightly earlier versions (GraalVM11 and javafx-web 17.0.0.1)"

neon pilot
#

and just by updating GraalVM it doesn't work any more?

#

Do you have a jfxwebkit.so somewhere?

#

In the JavaFX installation, in the Java installation or in the build directory