Home > other >  JavaFX program to JAR, been trying to do this for days
JavaFX program to JAR, been trying to do this for days

Time:07-17

Can anyone help me convert this javaFX application into an actual application using JAR, becuase ive been trying to convert it to a JAR for days and it just comes up with error after error. I just want to make an exe but i know how to do that, the JAR ive been trying to make and it makes it, but it never runs, just errors, a million of them.

Here's my github repo https://github.com/Amarnath-someperson/JavaFX-Physics-App with the code in JavaFX-Physics-App/PhysicsApp/src/main/java/com/example/physicsapp/

CodePudding user response:

Creating jars for JavaFX apps is not well supported and you just should not do it. Instead look here https://stackoverflow.com/tags/javafx/info in the Packaging section and create a real app bundle and installer.

CodePudding user response:

I recommend taking a look at this Github repo: https://github.com/wiverson/maven-jpackage-template

It contains a working projekt using Maven, JavaFX 17 and Java 17. Running maven install creates an installer and a runnable exe file. As soon as you get it running, making the necessary changes for your project should not be too difficult.

Asking others to do the complete work for you probably is a bit too much in my opinion. You will need to get a basic understanding of how the packaging works to maintain your project anyway, so I hope this is enough to get you started.

Packaging your application as jar is only useful up to Java(FX) 8, since JavaFX is not included in most JREs after that. So, while it is easy to create the jar, non-developers won't be able to run it.

  • Related