Home > Software design >  Building JavaFX Projects with JDK 11.0.2 and Eclipse?
Building JavaFX Projects with JDK 11.0.2 and Eclipse?

Time:08-06

I've spent too much time trying to find how to do this with. Tips for setting up a dev environment are what I am asking for, however I will start with what I tried so far.

As I understand JavaFX was separated from the JDK after JDK 8, however, for an R&D project, I need to create JavaFX applications that can be built and compiled in Java 11. Normally installing the e(fx)clipse plugins into Eclipse will not work unless a Java 8 installation is pointed to.

So, I have been following this guide: https://gist.github.com/stevenliebregt/bc62a382fc43064136b662ee62172ab3

JavaFX 11 is on LTS from Gluon, it seems, meaning I'd have to pay at least $900 to get it.

So instead, I tried building OpenJFX using following the instructions at this link: https://wiki.openjdk.org/display/OpenJFX/Building OpenJFX

When I start the build with Gradle, it fails because the minimum supported version for Java to build this is apparently 17.

Any suggestions for building JavaFX projects with JDK 11 is greatly appreciated.

CodePudding user response:

The LTS version is JavaFX 11.0.16. You can download non-LTS 11.x versions from GluonHQ by checking the "include older versions" checkbox on the download page.

Once you clicked it, you see all versions starting with 11 until 20-ea 1, even the obsolete ones.

Your best choice is probably 11.0.2

And to add something you didn't ask for: JDK 11 is compatible with the latest versions of JavaFX, even JavaFX 18, as you can see in the Release Notes:

"As of JDK 11 the JavaFX modules are delivered separately from the JDK. These release notes cover the standalone JavaFX 18 release. JavaFX 18 requires JDK 11 or later."

(I emphasized the last part of the quote)

CodePudding user response:

Thanks all, for the good information. I found that the best way to handle this way to build in IntelliJ instead. I can build and run JavaFX 18 easily with JDK 11.

  • Related