Tips-解决Exception in thread “main“ java.lang.NoClassDefFoundError: javafx/application/Application异常
·
@ZZHow(ZZHow1024)
环境
- JDK 21
- OpenFX 21
- Eclipse 2024-06
现象
- 运行后 Console 中出现下图中的异常信息

解决
-
单击绿色运行按钮右侧的黑色小三角 - 选择 Run Configurations…

-
选择 Arguments - 在 VM arguments 中添加下方的内容:
--add-modules javafx.controls,javafx.fxml -
取消勾选 Use the -XstartOnFirstThread argument when launching with SWT

参考文献
https://openjfx.io/openjfx-docs/#IDE-Eclipse

更多推荐
所有评论(0)