I'd like to create a fat JAR (uber JAR), that runs on double click, and contains all dependencies (JavaFX and other). 'm using Java 18, JavaFX 18, Maven and IntelliJ for my project. The project builds succesfully, and by using the package command I can create the fat JAR (using maven-shade-plugin), however on double click nothing happens. When I run it from command line, like java -jar jHasher-1.0-SNAPSHOT.jar I receive an exception. Details are below:

My shade plugin setup is the following:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                    <transformers>

                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>

                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>controller.Start</mainClass>
                        </transformer>

                    </transformers>
                    <minimizeJar>true</minimizeJar>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </execution>
        </executions>
    </plugin>

I have VM arguments as follows:

--module-path
"C:\\Program Files\\Java\\javafx-sdk-18.0.2\\lib"
--add-modules
javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web
--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED
--add-exports=javafx.web/com.sun.webkit.network=ALL-UNNAMED
--add-exports=javafx.web/com.sun.webkit.dom=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.scenario.animation.shared=ALL-UNNAMED
--add-exports=javafx.graphics/com.sun.javafx.tk.quantum=ALL-UNNAMED

The exception is the following:

jan. 16, 2023 2:25:24 DU. com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @521b1a11'
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:253)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
        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:278)
        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)

I have checked all StackOverflow sites related to this exception, but so far I did not found a solution. Please guide me to fix this issue.

EDIT:

I have run the JAR with the following (based on this forum: https://github.com/javafxports/openjdk-jfx/issues/237):

java -Djavafx.verbose=true -Dprism.verbose=true -jar jHasher-1.0-SNAPSHOT.jar

This has produced the following exception:

jan. 16, 2023 3:22:38 DU. com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @521b1a11'
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-console-l1-1-0.dll
Loaded library /api-ms-win-core-console-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-console-l1-2-0.dll
Loaded library /api-ms-win-core-console-l1-2-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-datetime-l1-1-0.dll
Loaded library /api-ms-win-core-datetime-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-debug-l1-1-0.dll
Loaded library /api-ms-win-core-debug-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-errorhandling-l1-1-0.dll
Loaded library /api-ms-win-core-errorhandling-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-file-l1-1-0.dll
Loaded library /api-ms-win-core-file-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-file-l1-2-0.dll
Loaded library /api-ms-win-core-file-l1-2-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-file-l2-1-0.dll
Loaded library /api-ms-win-core-file-l2-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-handle-l1-1-0.dll
Loaded library /api-ms-win-core-handle-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-heap-l1-1-0.dll
Loaded library /api-ms-win-core-heap-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-interlocked-l1-1-0.dll
Loaded library /api-ms-win-core-interlocked-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-libraryloader-l1-1-0.dll
Loaded library /api-ms-win-core-libraryloader-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-localization-l1-2-0.dll
Loaded library /api-ms-win-core-localization-l1-2-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-memory-l1-1-0.dll
Loaded library /api-ms-win-core-memory-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-namedpipe-l1-1-0.dll
Loaded library /api-ms-win-core-namedpipe-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-processenvironment-l1-1-0.dll
Loaded library /api-ms-win-core-processenvironment-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-processthreads-l1-1-0.dll
Loaded library /api-ms-win-core-processthreads-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-processthreads-l1-1-1.dll
Loaded library /api-ms-win-core-processthreads-l1-1-1.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-profile-l1-1-0.dll
Loaded library /api-ms-win-core-profile-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-rtlsupport-l1-1-0.dll
Loaded library /api-ms-win-core-rtlsupport-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-string-l1-1-0.dll
Loaded library /api-ms-win-core-string-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-synch-l1-1-0.dll
Loaded library /api-ms-win-core-synch-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-synch-l1-2-0.dll
Loaded library /api-ms-win-core-synch-l1-2-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-sysinfo-l1-1-0.dll
Loaded library /api-ms-win-core-sysinfo-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-timezone-l1-1-0.dll
Loaded library /api-ms-win-core-timezone-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-core-util-l1-1-0.dll
Loaded library /api-ms-win-core-util-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-conio-l1-1-0.dll
Loaded library /api-ms-win-crt-conio-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-convert-l1-1-0.dll
Loaded library /api-ms-win-crt-convert-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-environment-l1-1-0.dll
Loaded library /api-ms-win-crt-environment-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-filesystem-l1-1-0.dll
Loaded library /api-ms-win-crt-filesystem-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-heap-l1-1-0.dll
Loaded library /api-ms-win-crt-heap-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-locale-l1-1-0.dll
Loaded library /api-ms-win-crt-locale-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-math-l1-1-0.dll
Loaded library /api-ms-win-crt-math-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-multibyte-l1-1-0.dll
Loaded library /api-ms-win-crt-multibyte-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-private-l1-1-0.dll
Loaded library /api-ms-win-crt-private-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-process-l1-1-0.dll
Loaded library /api-ms-win-crt-process-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-runtime-l1-1-0.dll
Loaded library /api-ms-win-crt-runtime-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-stdio-l1-1-0.dll
Loaded library /api-ms-win-crt-stdio-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-string-l1-1-0.dll
Loaded library /api-ms-win-crt-string-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-time-l1-1-0.dll
Loaded library /api-ms-win-crt-time-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\api-ms-win-crt-utility-l1-1-0.dll
Loaded library /api-ms-win-crt-utility-l1-1-0.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\ucrtbase.dll
Loaded library /ucrtbase.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\vcruntime140.dll
Loaded library /vcruntime140.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\vcruntime140_1.dll
Loaded library /vcruntime140_1.dll from resource
WARNING: java.lang.UnsatisfiedLinkError: Can't load library: C:\Users\Thend\intellij-workspace\jHasher\bin\msvcp140.dll
Loaded library /msvcp140.dll from resource
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline
        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:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:383)
        at java.base/java.lang.Class.forName(Class.java:376)
        at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:833)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.ClassNotFoundException: com.sun.prism.sw.SWPipeline
        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:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:383)
        at java.base/java.lang.Class.forName(Class.java:376)
        at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:833)
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:253)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:266)
        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:278)
        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)
0

There are 0 answers