要在Eclipse上运行JavaFX 11+,必须遵循以下文档:https : //openjfx.io/openjfx-docs/#IDE-Eclipse。
如果您不使用Maven / Gradle构建工具:
- 从此处下载JavaFX 13 SDK
- 使用JavaFX jar创建JavaFX13库。
- 将VM参数添加到您的运行配置中。
JavaDoc和源
为了使javadoc和源代码正常工作,您不应该添加(很旧的)
jfxrt.jar,而这是从旧的JavaFX版本开始的,因此
由于软件包中的某些更改,您将出现不匹配的情况。
如果已经拥有JavaFX13库,则正确的做法是:
Edit the library (
Eclipse -> Preferences -> Java -> Build Path -> User Libraries -> JavaFX13
), and display all the jars included. If you display the content of any of these jars, you will probably see:Source attachment: (None)
Javadoc location: (None)
- Jar by jar, select
Source attachment
, press theEdit...
button, selectExternal location
, and find thesrc.zip
file under the lib folder of your local JavaFX SDK.
- Jar by jar, select
Jar by jar, select
Javadoc location
, press theEdit...
button, select Javadoc URL, and pastehttps://openjfx.io/javadoc/13/
.完成后应用并关闭。
现在,将鼠标悬停在任何JavaFX类上时都应获取Javadoc,并且
在按住Ctrl键并单击JavaFX类时也应访问源代码。



