如何在 macOS 上让 JavaFX 在 Visual Studio Code 中工作?

huangapple 未分类评论44阅读模式
英文:

How do I make JavaFX work on mac(Visual Studio Code)?

问题

以下是翻译好的内容:

所以我尝试在我的 Mac 上创建一个 JavaFX 应用程序,但是我无法弄清楚我做错了什么。
我听说 JavaFX 已经和 JDK 捆绑在一起了。
我正在使用最新的 JDK 和 Java。
我使用 Visual Studio Code。有时我也会用 Eclipse。
我的操作系统是 macOS Catalina 版本 10.15.3。

所以问题是:
当我尝试导入 JavaFX 时,它给了我一个错误。
错误信息是:无法解析导入 JavaFX
为什么会发生这种情况,我应该如何修复这个问题?

英文:

So I tried making a JavaFX application on my Mac, and I can't figure out what I'm doing wrong.
I heard that JavaFX is bundled with JDK.
I am using the latest JDK and Java.
I use Visual Studio Code. Sometimes I also use Eclipse.
My operating system is macOS Catalina version 10.15.3.

So here's the problem:
When I try to import JavaFX, it gives me an error.
The error says: The import JavaFX cannot be resolved
Why does this happen and how can I fix this?

答案1

得分: 0

JavaFX现在不再随Java JDK捆绑,JFX库是一个独立的库,必须从openjfx.io下载并链接到您的项目。

英文:

JavaFX is NOT bundled with the Java JDK anymore, the JFX library is a separate library that must be downloaded from openjfx.io and linked to your project.

huangapple
  • 本文由 发表于 2020年4月5日 02:13:48
  • 转载请务必保留本文链接:https://java.coder-hub.com/61032649.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定