mindolph/Mindolph

can not run .jar at windows

mahengrui1 opened this issue · 7 comments

hello, idk much about Java so here is just the log, windows 11 x64:

PS C:\Program Files\Java\jdk-17.0.4+8-jre\bin> .\java -jar "C:\Users\Henry\Desktop\IT Support\Mindolph-1.0-beta5.jar"
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-10-01 10:38:47,425 main WARN The bufferSize is set to 8192 but bufferedIo is false: false
10:38:47  INFO        PreferenceManager:  62 - Initialize preference for class: class com.mindolph.desktop.Launcher
Oct. 01, 2022 10:38:47 A.M. com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @a9f6af'
Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        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(Unknown Source)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        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(Unknown Source)
PS C:\Program Files\Java\jdk-17.0.4+8-jre\bin>

above is jre, now it is jdk:

PS C:\Program Files\Java\jdk-17.0.4+8\bin> .\java -jar "C:\Users\Henry\Desktop\IT Support\Mindolph-1.0-beta5.jar"
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-10-01 10:43:48,174 main WARN The bufferSize is set to 8192 but bufferedIo is false: false
10:43:48  INFO        PreferenceManager:  62 - Initialize preference for class: class com.mindolph.desktop.Launcher
Oct. 01, 2022 10:43:48 A.M. com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @13291e3'
Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        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)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        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)
PS C:\Program Files\Java\jdk-17.0.4+8\bin>

For Windows, I suggest that download and install Mindolph-1.0-beta5.msi to save your time.

But if you really want to run the jar file, since JavaFX is not included in JDK, you should download latest JavaFX SDK for Windows from here:

https://gluonhq.com/products/javafx/

and run like this:

java --module-path C:\javafx-sdk-19\lib --add-modules java.sql,javafx.controls,javafx.fxml,javafx.swing,javafx.web -jar Mindolph-1.0-beta5.jar
PS C:\Program Files\Java\jdk-17.0.4+8\bin> .\java --module-path "C:\Program Files\Java\javafx-sdk-19\lib" --add-modules java.sql,javafx.controls,javafx.fxml,javafx.swing,javafx.web -jar "C:\Users\Henry\Desktop\IT Support\Mindolph-1.0-beta5.jar"
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
2022-10-05 13:34:02,920 main WARN The bufferSize is set to 8192 but bufferedIo is false: false
13:34:03  INFO        PreferenceManager:  62 - Initialize preference for class: class com.mindolph.desktop.Launcher
Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at javafx.graphics@19/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
        at javafx.graphics@19/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
        at javafx.graphics@19/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:268)
        at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at javafx.graphics@19/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
        at javafx.graphics@19/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
        at javafx.graphics@19/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
        at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
        at javafx.graphics@19/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
        at javafx.graphics@19/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:833)
PS C:\Program Files\Java\jdk-17.0.4+8\bin>

yeah, I may consider a non portable version

I tried again on Windows 10 and it worked, besides,I found a Windows 11 laptop and tried, it worked too. are your sure you have downloaded the right JavaFX SDK? for my test, it was JavaFX Windows x64 SDK. Could you check it?

image

yeah it is JavaFX Windows x64 SDK and i believe windows 11 or 10 does not matter. maybe my Java is different:

https://adoptium.net/temurin/archive jdk-17.0.4+8
image

the command is PS C:\Program Files\Java\jdk-17.0.4+8\bin> .\java --module-path "C:\Program Files\Java\javafx-sdk-19\lib" --add-modules java.sql,javafx.controls,javafx.fxml,javafx.swing,javafx.web -jar "C:\Users\Henry\Desktop\IT Support\Mindolph-1.0-beta5.jar"

besides the .msi works

I downloaded the JDK you mentioned and run the jar file with JavaFX SDK 19, as you can see in screenshots, everything is fine.
It's really weird, to diagnose this problem, is it possible for you to run on another Windows PC?

startup

about

2022-10-08 01-18-38屏幕截图

it is solved! I update to jdk-17.0.4.1+1 published at 202208(the newest, the old one is from 202207) and the terminal looks exactly same as your last reply. thank u kind sir!