> On Sep 6, 2021, at 2:15 PM, Will Hartung <willhart...@gmail.com> wrote:
> 
>> On Sun, Sep 5, 2021 at 2:09 PM Scott Palmer <swpal...@gmail.com> wrote:
>> 
>> The easiest way to get JavaFX working smoothly is to use a JDK that has 
>> JavaFX modules built-in.  Azul and BellSoft provide such installs of Open 
>> JDK as free downloads.  They make development with JavaFX simpler, I 
>> recommend them.
> 
> That may be, but, honestly, I haven't had any real problems with the maven 
> projects using whatever random JDK I have been running and having it download 
> the dependencies maven style.
> 
> The FX projects do have a unique POM, as the projects need a special starting 
> sequence. For example, you can't just right click on App.java and click Run, 
> you have to run the project so it can do its magic.
> 
> Maybe that's different for a JDK with FX installed.
> 
> I prefer having the project and maven do the heavy lifting than require a 
> magic JDK.
> 
> Regards,
> 
> Will Hartung

Nothing wrong with either approach. But yes, one of the differences is that you 
can “just run” App.java without a complex command line or anything special like 
that.
I also have Gradle projects that use the plugins and follow the guidelines from 
OpenJFX.io.  That would certainly be the way to go for any project that I 
intended to share with others.  Though having JavaFX modules in the JDK isn’t 
too magical.  It is a supported way to bundle things.  The jlink tool will 
build such images for you.

One of the issues I have with the Maven/Gradle plugins is that they don’t use 
jmods as they should because the .jmod files are not available from dependency 
repositories and can only be used at compile and link time, not runtime.  That 
complicates making the final embedded JRE for when I package the app with 
jpackage.  For that reason I tend to roll my own Gradle script to build a JRE 
image from jmods anyway.  I’ve put the jmods in my private Artifactory so there 
is no need to install the JavaFX SDK to get them.

Regards,
Scott

Reply via email to