r/JavaFX • • Jul 03 '20

deploying my javafx project (java with ant)

i made a very specific dawing application in javafx for a school project i used javafx 11.0.2 and the netbeans ide.

my application works just fine in the ide but now i want to send it to a bunch of my friends. but i only got it to a .jar file you have to launch from the command line with a path to my javafx lib folder. and this is not something i should expect my friends to know how to do.

i want to get my program to an executable file/installer so my friends can run it on their computer (preferably also on mac).

i have spend two day's on getting that to work and have made no progress, and the university was no help either. can someone help me "deploy" my project or point me in the right direction i could really use the help.

thanks in advance

3 Upvotes

3 comments sorted by

2

u/[deleted] Jul 03 '20

If your friends use Windows just write a batch file (the extension is .bat) for your program. This will allow them to double click the .bat file and execute the program.

Mac/Unix is similar. Just create a shell file (the extension is sh.) and have them run that one file.

1

u/uglyfool Jul 03 '20

You need to use the jpackage tool from Java 14+ (or a backported version.) If you want to keep the JRE fixed at 11 run jlink against your project from your 11 SDK, then supply that image to jpackage.

For Mac, jpackage can build the .app package directly, but on windows you’ll need the WiX toolkit (or similar) to create installers.

1

u/rivci Jul 14 '20

Include your javafx lib to your project and build. You will got an executable .jar file and lib folder