JavaFX模块对于VM不可见 [英] JavaFX Modules are not visible for VM
问题描述
我正在使用Intellij Idea作为我的IDE.由于需要使用css文件,因此我安装了Intellij Ultimate.现在,javaFx不能同时在两者上使用.
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.
引发异常:
启动层初始化期间发生错误 java.lang.module.FindException:找不到模块javafx.controls
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.controls not found
VM设置与以前的IDE完全相同.出乎意料的是-如果我只在--add-modules=""
中放入一个jar,则控制台中显示的丢失的jar是上面指令中存在的jar.例如:
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
用于前面显示的控制台输出.
--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
启动层初始化期间发生错误 java.lang.module.FindException:找不到模块javafx.swing
Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.swing not found
javafx的lib
文件夹的路径有效.我不知道为什么它不起作用.
The path to lib
folder of javafx is valid. I don't have any idea why is it not working.
推荐答案
我找到了答案.我安装了Ultimate 2018.3版本,该版本需要一个路径变量.我在选项中添加了路径变量,并用路径变量替换了路径(在VM选项中).现在就可以了.
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.
当前VM选项输入如下:
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
这篇关于JavaFX模块对于VM不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!