Last active
December 7, 2025 06:27
-
-
Save Da9el00/df8efbc8de53cd39463c05cbeb0503d3 to your computer and use it in GitHub Desktop.
Plugin to make JavaFX executable jar with Maven
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-shade-plugin</artifactId> | |
| <executions> | |
| <execution> | |
| <goals> | |
| <goal>shade</goal> | |
| </goals> | |
| <configuration> | |
| <shadedArtifactAttached>true</shadedArtifactAttached> | |
| <transformers> | |
| <transformer implementation= | |
| "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | |
| <mainClass>Your_main_class_here</mainClass> | |
| </transformer> | |
| </transformers> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> |
Author
i did some digging, for me the problem was "version" tag was missing, adding version tag fixed the issue for me.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation=
"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.game.hangman.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
.
I did all you showed in the youtube video, when i double click my .jar file, it shows a Java Virtual Machine Launcher dialog box with the message "A Java exception has occurred.", so i tried running the jar file with java -jar filename.jar and the application ran (meaning the GUI showed), but on cmd it gave the following output as well:
Dec 29, 2024 4:18:52 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @5296abc5'
me too
when i click on the shaded jar file its not running . How can i make it run ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is my best idea:
Run a force re-import from the maven tool window. If that does not work, you could try to Invalidate your caches (File -> Invalidate caches) and restart. I think this is a problem with the plugin not being loaded correctly, so a restart and reload might do the trick.