错误:JavaFX运行时组件缺少Linux IntelliJ

jjjwad0x  于 2022-11-22  发布在  Linux
关注(0)|答案(1)|浏览(128)

我在一台Linux机器上,试图运行一个javaFX应用程序,但我被卡住了。我一直在标题中看到错误。IntelliJ在错误之前正在运行以下命令:

/usr/lib/jvm/java-17-openjdk-amd64/bin/java -javaagent:/opt/IntelliJ/lib/idea_rt.jar=38753:/opt/IntelliJ/bin -Dfile.encoding=UTF-8 -classpath /home/j3rk/IdeaProjects/C195/out/production/C195:/home/j3rk/.m2/repository/mysql/mysql-connector-java/8.0.27/mysql-connector-java-8.0.27.jar:/home/j3rk/.m2/repository/com/google/protobuf/protobuf-java/3.11.4/protobuf-java-3.11.4.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-base/12-ea+6/javafx-base-12-ea+6.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-base/12-ea+6/javafx-base-12-ea+6-linux.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-controls/11/javafx-controls-11-linux.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-graphics/11/javafx-graphics-11-linux.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-base/11/javafx-base-11-linux.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-fxml/11/javafx-fxml-11.jar:/home/j3rk/.m2/repository/org/openjfx/javafx-fxml/11/javafx-fxml-11-linux.jar sample.Main

正如您所看到的,我已经尝试通过Maven添加openjfx依赖项,但仍然不起作用。
我已经尝试了在中找到的解决方案:Error: JavaFX runtime components are missing - JavaFX 11 and OpenJDK 11 and Eclipse IDE
另外两个javaFX项目在同一台计算机上加载正常,但由于某种原因,无论我尝试什么,这个特定的项目总是给我同样的错误。
Screenshot of my modules/dependencies
如果你需要更多的信息,请告诉我。任何帮助都将不胜感激。

falq053o

falq053o1#

此视频帮助:https://www.youtube.com/watch?v=ZfaPMLdgJxQ&ab_channel=BoostMyTool
特别是我所做的是:
1.从以下网站下载SDK:https://gluonhq.com/products/javafx/
1.在Idea Intelij(在运行菜单中)编辑配置-〉添加虚拟机选项:

--module-path /path-to-sdk/lib/ --add-modules javafx.controls,javafx.fxml

终于成功了!

相关问题