[英]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? 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.最简单的解决方案是将 Java 安装替换为包含 JavaFX/ OpenJFX库的安装。
At least two vendors offer such a product, both are free-of-cost:至少有两家供应商提供这样的产品,两者都是免费的:
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.或者,您可以下载 JavaFX/OpenJFX 库,将它们放在 Java 检测到的文件夹中,正如我们所说的“在类路径上”。
Java 16 and JavaFX/OpenJFX 16 are current, but both are only supported until their versions 17 arrives later this year in September 2021. Java 16 和 JavaFX/OpenJFX 16 是最新的,但仅在它们的版本 17 在今年晚些时候(即 2021 年 9 月)到来之前都受支持。
You could also ask the publisher of that app to release the app with a Java runtime bundled, including the JavaFX/OpenJFX libraries.您还可以要求该应用程序的发布者发布该应用程序,其中捆绑了 Java 运行时,包括 JavaFX/OpenJFX 库。 Recent innovations in tooling ( jlink , jpackage , Java Platform Module System ) make this more practical now.工具方面的最新创新( jlink 、 jpackage 、 Java 平台模块系统)现在使其更加实用。
The question is quite lacking, though I ran into the same(?)/similar problem.尽管我遇到了相同的(?)/类似的问题,但这个问题非常缺乏。 Here is what you do:这是你要做的:
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) 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将路径和 jar 切换到您拥有的任何东西)After that, the program hopefully runs just fine在那之后,程序希望运行得很好
If you need Swing as well, then add it: "... javafx.controls,javafx.swing..."如果您还需要 Swing,请添加:“... javafx.controls,javafx.ZCE04E520DB25C30558A...”
If you want you can make an environment variable, %PATH_TO_FX%, and use that.如果您愿意,可以创建一个环境变量 %PATH_TO_FX%,然后使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.