【发布时间】:2020-04-08 06:22:02
【问题描述】:
我正在尝试在我的应用程序中生成 JavaDocs,但是,当我尝试它时,我收到以下消息:
...\application\src\module-info.java:5: error: module not found: javafx.base
requires javafx.base;
^
...\application\src\module-info.java:6: error: module not found: javafx.fxml
requires javafx.fxml;
^
...\application\src\module-info.java:7: error: module not found: javafx.graphics
requires transitive javafx.graphics;
^
...\application\src\module-info.java:8: error: module not found: javafx.media
requires javafx.media;
^
...\application\src\module-info.java:9: error: module not found: javafx.controls
requires javafx.controls;
^
...\application\src\module-info.java:10: error: module not found: org.junit.jupiter.api
requires org.junit.jupiter.api;
而且我不确定这意味着什么。我试过用谷歌搜索,但没有发现任何有用的东西,发现了一个非常相似的问题,但从未得到回答。可能是什么问题?
我的类文件路径如下:...\application\src\game\game.main
我的modulepath文件路径如下:...\application\src\module-info.java
我的应用程序运行良好,所以我不确定问题出在哪里。
这就是我的 module-path.java 的样子:
module froggerGame
{
exports frogger.helper;
exports frogger.builders;
exports tests;
exports frogger.controllers;
exports frogger.world;
exports frogger.actors;
exports frogger.game;
requires javafx.base;
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.media;
requires org.junit.jupiter.api;
}
编辑:我设法解决了这个问题,问题是我没有正确设置我的 Java 可执行变量(JAVA_HOME、PATH_TO_FX),然后在 JavaDocs 的 VM 参数中,我必须包含 @987654324 @bit 以及我的 lib 文件夹在 JavaFX 中的位置
谢谢。
【问题讨论】:
-
请准确描述重现问题的每个步骤。我不知道您所说的 "classes filepath" 是什么意思。 modulepath 不是
module-info.java的路径,而是在使用JPMS 时替代classpath。 -
类文件路径,也就是我所有类所在的位置。要重现它,你点击 Project->Generate JavaDocs->press Finish-> 它出现在控制台的底部,我没有提供任何参数或类似的东西,就像它最初的样子
-
通过
--add-modules将所需模块添加到Javadoc 向导中的VM 选项是否有效? bugs.eclipse.org/bugs/show_bug.cgi?id=543405#c2 -
@howlger 感谢您的建议,不幸的是它仍然不起作用:/我添加了
--add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,org.junit.jupiter.api,javafx.swing -
完全相同的错误信息?你使用 Eclipse 2019-09 (4.13) 吗?