Reputation: 9137
I want to create a executable jar. I read how to make a MANIFEST.MF, but I read with maven is pretty much easier:
but that solution doesn't include the fxml files.
Do you know a plugin for that or some tutorial that explain how and where I should insert the fxml files.
I noted that solution doesn't include gif or other file to jar too. So, I think that the should be a same solution to include other types of files to jar.
I'm near to deadline (yesterday). So any help that permit me make it in 5 min (anyone can dream) will be more than welcome.
Thank in advance.
Upvotes: 0
Views: 8757
Reputation: 499
You can use Zenjava-Javafx-maven-plugin
for this. Just add this to your pom.xml
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>your.package.with.Launcher</mainClass>
</configuration>
</plugin>
Than use mvn jfx:jar
command to create javafx jar
. The jar-file
will be placed at target/jfx/app
.
If you wish to create a javafx native bundle, use this configuration,
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>YourCompany</vendor>
<mainClass>your.package.with.Launcher</mainClass>
</configuration>
</plugin>
and this command: mvn jfx:native
. The native launchers or installers will be placed at target/jfx/native
.
Upvotes: 1
Reputation: 8900
to create executable jar's of javaFX projects using maven follow this tutorial : from-zero-to-javafx-in-5-minutes
Using this plugin it’s much, much easier to get up and running quickly and to build complicated distribution bundles (such as executable JAR files, native installers and webstart bundles)
Upvotes: 0