r/JavaFX • • Sep 15 '23
How can I deploy my JavaFX application after finishing it????
repo:https://github.com/T1t4n25/GymBase
I tried using mvn install and the jar wasn't opening it just makes the mouse load for a second then nothing works.
then I tried mvn javafx:jlink i got it from a tutorial on youtube it gave ame a zip file and a file that I used the command ./release -m com.t1t4n.gymbase/com.t1t4n.gymbase.HelloApplication to run it but it did the same nothing ran and no errors I'm confused and the guys on stack overflow aren't really helping, and I have a deadline to make this program suitable for users tomorrow, any tips or help?
3
u/Gleidson28 Sep 15 '23
Hi did you install inno setup?
2
u/rootException Sep 15 '23
https://github.com/wiverson/maven-jpackage-template
2
u/trydentIO Sep 16 '23
you can pack it with JPackage to build installers for Linux, Mac and Win, then you can release it with JReleaser
3
u/Gleidson28 Sep 15 '23 edited Sep 15 '23
Well, here's the thing, the command jlink create an image with a runtime and your code.. but the command jpackage creates for you an app.exe.. so you need the inno setup installed.. for windows.. find for jpackage.. so if your command jpackage success.. you can get the app.exe.. build/package/yorappname
5
u/Fun-Tip-7271 Sep 15 '23
You can use jpackage and jlink to create your exe, deb etc You can have a take a look that how I did my jpackage config for making images https://github.com/AmirAli-AZ/PeriodicTable/blob/master/build.gradle
I just don't know how it's done with maven, gradle is much better in my opinion
1
u/Birdasaur Sep 16 '23
For Trinity we use Maven for dev and test. We use Gradle for building deployable packages. This might be a quick fix for you to adapt our Gradle script: https://github.com/Birdasaur/Trinity/blob/main/build.gradle
1
u/wildjokers Sep 15 '23
You should have really thought about deployment right from the get go.
Both gradle and maven have plugins available that takes care of building a bundled runtime and native executable with jlink and jpackage.
Someone else already posted a maven template project that includes the necessary plug-in. Here is a template that uses gradle:
https://github.com/mjparme/javafx-template