JavaFX Modules are not visible for VM

夙愿已清 提交于 2019-12-10 15:46:47

问题


I was using Intellij Idea as my IDE. Since I needed to use css files, I've installed Intellij Ultimate. Now javaFx is not working on both of them.

Thrown exception:

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

The VM settings are exacly the same, as in the previous IDE. Suprisingly- if I put only one jar in --add-modules="", the missing jar, shown in the console, is the one present in the instruction above. E.g:

--module-path="C:\\javafx-sdk-11.0.1\\lib" --add-modules=javafx.controls for the console output shown earlier.

--module-path="C:\\javafx-sdk-11.0.1\\lib" --add-modules=javafx.swing for

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

The path to lib folder of javafx is valid. I don't have any idea why is it not working.


回答1:


I've found an answer to it. I installed Ultimate 2018.3 version, which requires a path variable. I added a path variable in options and replaced (in VM options) the path with the path variable. And now it works.

Current VM options input looke like:

--module-path ${PATH_TO_FX} --add-modules=javafx.controls,javafx.fxml,javafx.base,javafx.media,javafx.graphics,javafx.swing,javafx.web



来源:https://stackoverflow.com/questions/53694905/javafx-modules-are-not-visible-for-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!