启动层java.lang.module.FindException 初始化时出错:Module javafx.controls not found 当在vscode 中使用JavaFX 时

时间:2021-04-06 00:59:10

标签: java json javafx visual-studio-code

我正在尝试使用 vscode 在 JavaFX 中工作(如果它有任何不同,我在 macOS 上),无论何时我尝试运行我的代码,它都会给我这个错误:

Error occurred during initialization of boot layer 
java.lang.module.FindException: Module javafx.controls not found

这只发生在我在 launch.json 文件中有这些 vmArgs 时:

"vmArgs": "--module-path /javafx/lib/src/javafx.controls --add-modules javafx.controls"

如果我在 json 中没有那些 vmArgs,我会收到这个错误:

Error: JavaFX runtime components are missing, and are required to run this application.

我应该怎么做才能让它运行?为什么它没有识别出我在我的 json 中引用了 javafx.controls 模块,但是当我没有它时,我又收到另一个错误?任何帮助将不胜感激,因为我真的不知道该往哪个方向走。

0 个答案:

没有答案