0

I created JavaFx application on Windows.Then created jar file which works normal on windows.But when i try run this jar on Linux Mint i get this log:

нояб. 07, 2022 3:15:00 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6a7840b4'
java.lang.ClassNotFoundException: com.sun.glass.ui.gtk.GtkPlatformFactory
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
 at java.base/java.lang.Class.forName0(Native Method)
 at java.base/java.lang.Class.forName(Class.java:375)
 at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:42)
 at com.sun.glass.ui.Application.run(Application.java:146)
 at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:291)
 at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:293)
 at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
 at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
 at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
 at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
 at java.base/java.lang.Thread.run(Thread.java:833)
Failed to load Glass factory class
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.sun.glass.ui.PlatformFactory.createApplication()" because the return value of "com.sun.glass.ui.PlatformFactory.getPlatformFactory()" is null
 at com.sun.glass.ui.Application.run(Application.java:146)
 at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:291)
 at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:293)
 at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
 at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
 at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
 at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
 at java.base/java.lang.Thread.run(Thread.java:833)

I installed on Linux openjfx and i have openjdk 17.0.4. Please, i'm waiting any help.

Aqua
  • 9
  • 2
  • Did you install that with the package manager? – g00se Nov 07 '22 at 15:15
  • I'm sorry, i did not understand, what do you mean ? – Aqua Nov 07 '22 at 15:41
  • How did you install openjfx? – g00se Nov 07 '22 at 19:01
  • You don't describe how you created the jar which works on Windows and what is in it, nor the command you use to execute it, whether everything is packed in a single jar or if you have multiple jars, and whether you rely on JavaFX components being in the jar or separate. While you may or may not use maven, the principle of creating a cross-platform Jar that contains JavaFX components is similar to the marked duplicate question. In any case, a platform-specific build using jlink or jpackage is usually recommended instead. – jewelsea Nov 07 '22 at 19:26

0 Answers0