简体   繁体   English

我的Java版本不知道怎么安装JavaFX

[英]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:至少有两家供应商提供这样的产品,两者都是免费的:

  • LibericaFX , from BellSoft LibericaFX , 来自 BellSoft
  • Azul Platform Core , the “JDK FX” edition, formerly known as ZuluFX , from Azul Systems. Azul Platform Core ,“JDK FX”版本,以前称为ZuluFX ,来自 Azul Systems。 (On their download page, use their pop-up menus to get “JDK FX”.) (在他们的下载页面上,使用他们的弹出菜单获取“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.或者,您可以下载 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.工具方面的最新创新( jlinkjpackageJava 平台模块系统)现在使其更加实用。

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)下载Java FX: https://gluonhq.com/products/javafx/ (下载前一定要检查版本)
  2. Put the sdk folder you just downloaded somewhere.将您刚刚下载的 sdk 文件夹放在某处。 (eg inside C:\Program Files\Java\ ) (例如在 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) 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.

相关问题 我不知道如何在Java中安装JEasyOPC - I don't know how to install JEasyOPC in Java 我在 Java 中的一个布尔方法没有返回 true,我不知道如何更正 - One of my boolean methods in Java is not returning true and i don't know how to correct that 我的代码出现错误,我不知道如何修复(Java fx stackPane) - I am getting errors in my code and i don't know how to fix(Java fx stackPane) 我不知道如何在macOS控制台JAVA中编写命令以显示文件的方向 - I don't know how to write a command to show direction to my file in macOS console, JAVA 不知道如何减去也不知道如何比较错误Java中的Cypher查询 - Don't know how to subtract and Don't know how to compare error Cypher query in Java JavaFX-我不知道如何使TableView可编辑 - JavaFX - I don't understand how to make my TableView editable 我的Java Chatbot代码不起作用,我也不知道为什么 - My Java Chatbot code don't work and i don't know why 不知道如何在 JFormattedTextField 上修复我的 PropertyChangeListener - Don't know how to fix my PropertyChangeListener on a JFormattedTextField 我不知道如何使用工具提示 - I don't know how to get my tooltips to work 不知道如何为我的界面对象分配变量 - Don't know how to assign variable to my interface objects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM