0

I'm a former VB6 programmer, just now getting back into coding. I like Java, because it is multi-platform. I'm going through the learning process now, but I have some concerns, that hopefully you guys can help me understand.

I want to write GUI stand-alone shareware programs, but I learned that swing is now outdated, and JavaFX has been split from from Java.

My concern is deployment. What if an end user has no java installed? Am I allowed to install the JRE and JavaFX as part of my own installer? Remember ... this will be for shareware, with many thousands of downloads. I want to make it as easy as possible for the end user to download/install my programs.

Please share what you know on this subject.

Thanks!!

MontanaMan
  • 177
  • 1
  • 1
  • 11
  • Having said all these things ... my 2 cent: I think the day of desktop java clients are more or less over. The security issues killed java for private users, Java is still an excellent choice for the "enterprise" style backend coding (albeit, for personal projects I would definitely use Kotlin) ... but for "frontend" related stuff, I would definitely go for something that runs in the browser. – GhostCat Jun 25 '19 at 18:11
  • 2
    See https://stackoverflow.com/questions/53453212/how-to-deploy-a-javafx-11-desktop-application-with-a-jre. As of Java 11, you package your application with a stripped-down JRE that includes only the modules your application requires. – VGR Jun 25 '19 at 19:03
  • Thank you VGR. That's a very helpful answer to my specific questions. – MontanaMan Jun 25 '19 at 22:04

2 Answers2

0

There's the javapackager utility which is designed to make, for lack of a better word, "stand alone EXE" for Windows, Mac OS, Linux. This bundles not just all of your jars and such, but also a JRE with the application. So, the user doesn't need to download anything else.

Now, mind, this was with Java 8, before FX was pulled out, so you'll need to look around to see what the situation is with the most recent JDKs. Ideally the functionality was not completely removed from the JDK.

I have not used it personally.

Will Hartung
  • 115,893
  • 19
  • 128
  • 203
0

A java packager is bundled with Java8 and there will be a new packager targeted for Java 14. A working pre-release can be downloaded here: http://jdk.java.net/jpackage/ I already use it in my build process and it just works.

mipa
  • 10,369
  • 2
  • 16
  • 35