Java FX 模块化应用程序,未找到模块(Java 11、Intellij) [英] Java FX Modular Application, Module not found (Java 11, Intellij)
问题描述
您好,我的模块化 Java FX 应用程序有问题.
Hello I have a problem with my modular Java FX Application.
首先,我使用 Intellij 向导创建了一个 JavaFX 项目.
我添加了 Java FX 库:
First of all I created a JavaFX Project with the Intellij Wizard.
I added the Java FX lib:
JavaFX 模块得到认可.我的模块信息.java:
And the JavaFX modules get recognized. My module-info.java:
我还添加了 VM 选项:
I also added the VM options:
但我总是收到此错误消息:
But I always get this errormessage:
启动层初始化时出错
java.lang.module.FindException: 未找到模块 HelloFX"
"Error occured during initialization of boot layer
java.lang.module.FindException: Module HelloFX not found"
谢谢.
推荐答案
出现错误时:
启动层初始化时出错
java.lang.module.FindException:未找到模块 HelloFX
java.lang.module.FindException: Module HelloFX not found
表示--module-path
中问题模块的路径错误,找不到模块.
it means that the path to the module in question in --module-path
is wrong and the module can't be found.
检查输出文件夹.根据您的第一张图片,HelloFX
项目的输出转到 out
,但您的 VM 选项将相对路径设置为 mods
.
Check the output folder. Based on your first picture, the output of the HelloFX
project goes to out
, but your VM options you are setting the relative path to mods
.
您可以从 IntelliJ -> 配置编译器输出文件 ->项目结构 ->项目 ->项目编译输出
.
默认情况下,在 Windows 上,当您创建 JavaFX 项目时,IntelliJ 指向 path-toHelloFXout
.
On Windows by default, when you create a JavaFX project, IntelliJ points to path-toHelloFXout
.
然后,您可以将该编译输出路径修改为 path-toHelloFXmods
,或者您的 VM 参数:
Then you either modify that compile output path to path-toHelloFXmods
, or your VM arguments:
--module-path "path-tojavafx-sdk-11.0.1lib;outproduction"
这篇关于Java FX 模块化应用程序,未找到模块(Java 11、Intellij)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!