0

We currently have a product that was built using Java 8 a few years back. We are now in the process of updating our software's UI using JavaFX and need it to run with Java 11. We want to be able to progressively move towards Java 11, without losing the ability to use our products with Java 8. So far, I have been able to build and run my product using Java 8, however, when I try to run using Java 11, I get the error :

Error: JavaFX runtime components are missing, and are required to run this application.

In my

Settings >> Project Settings

my SDK is set to azul-1.8-fx and I have imported the Java 11 SDK into my

Settings >> Libraries

to try and get it to run with the JavaFX 11 components, however, I still get the same error.

If anyone knows the proper way to build and run on different versions of Java, the help would be greatly appreciated.

I have attached a copy of my Project Settings as well as my SDK Settings

Ali Haidar
  • 13
  • 3
  • Does this answer your question? [Error: JavaFX runtime components are missing, and are required to run this application with JDK 11](https://stackoverflow.com/questions/51478675/error-javafx-runtime-components-are-missing-and-are-required-to-run-this-appli) – Arsh Coder Dec 10 '21 at 13:58
  • No, unfortunately I tried that and was still getting the same results. :/ I recently came across the `toolchains` tool from maven that might seem like the solution to this issue. Will look more into it – Ali Haidar Dec 10 '21 at 14:53
  • 3
    openjfx.io has documentation on how to run a [javafx 11+ app in idea](https://openjfx.io/openjfx-docs/#IDE-Intellij), you can follow that. – jewelsea Dec 10 '21 at 15:52
  • 5
    I recommend just scrapping Java 8 and 11 support for your app and using only Java 17 + JavaFX 17. Use jlink or jpackage so there are no external java version dependencies. – jewelsea Dec 10 '21 at 15:53
  • 3
    If your really want to use Java 8 and 11, I suggest you setup two different projects (pom files) for your source code, one which is targeted at Java 8 so you can test that, and one which is targeted at Java 11 so you can test that. If you are using Maven, create two pom.xml files and load one or the other into your IDE. The Java 8 project won't need JavaFX dependencies as they are in (some) Java 8 distibutions, the Java 11 project can have JavaFX 11 maven dependencies. – jewelsea Dec 10 '21 at 15:55

0 Answers0