简体   繁体   中英

Don't know how to install JavaFX for my Java version

Recently I downloaded a program, and when I try to open it, a pop up appears saying "Please install JavaFX for your Java version (15.0.1)" What can I do to install JavaFX for my Java version?

The easiest solution is to replace your Java installation with one that includes the JavaFX/ OpenJFX libraries.

At least two vendors offer such a product, both are free-of-cost:

  • LibericaFX , from BellSoft
  • Azul Platform Core , the “JDK FX” edition, formerly known as ZuluFX , from Azul Systems. (On their download page, use their pop-up menus to get “JDK FX”.)

Or you can download the JavaFX/OpenJFX libraries, placing them in a folder where they will be detected by Java, “on the classpath” as we say.

Java 16 and JavaFX/OpenJFX 16 are current, but both are only supported until their versions 17 arrives later this year in September 2021.

You could also ask the publisher of that app to release the app with a Java runtime bundled, including the JavaFX/OpenJFX libraries. Recent innovations in tooling ( jlink , jpackage , Java Platform Module System ) make this more practical now.

The question is quite lacking, though I ran into the same(?)/similar problem. Here is what you do:

  1. Download Java FX: https://gluonhq.com/products/javafx/ (be sure to check the version before download)
  2. Put the sdk folder you just downloaded somewhere. (eg inside C:\Program Files\Java\ )
  3. Then open cmd, and start the program as so: java --module-path "path\to\javafx-sdk-15.0.1\lib" --add-modules javafx.controls -jar [the jar file] (of course switch out the path and jar to whatever you had)

After that, the program hopefully runs just fine

If you need Swing as well, then add it: "... javafx.controls,javafx.swing..."

If you want you can make an environment variable, %PATH_TO_FX%, and use that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM