9

I'm trying to generate JavaDocs in my application, however, when I try it, I get the following message:

...\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;

And i'm not exactly sure what it means. I've tried googling it but didn't really find anything useful, found a very similiar question but it was never answered. What could be the issue?

My classes filepath is as follows: ...\application\src\game\game.main

My modulepath filepath is as follows:...\application\src\module-info.java

My application runs fine so i'm not really sure what the issue could be.

This is how my module-path.java looks like:

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;
}

EDIT: I managed to fix the issue, the problem was that I didn't set up my Java Executable Variables correctly (JAVA_HOME , PATH_TO_FX) and then in the arguments of the VM for JavaDocs, I had to include the --add-module bit as well as the location of my lib folder in JavaFX

Thanks.

8
  • Please describe exactly each step to reproduce the issue. I don't know what you mean by "classes filepath". The modulepath is not the path to the module-info.java, but the replacement for the classpath when using JPMS. Commented Dec 15, 2019 at 21:09
  • Classes filepath aka where all of my classes are located. Well to reproduce it you click on Project->Generate JavaDocs->press Finish-> and it appears in the bottom of the console, I don't provide any arguments or anything like that just how it is initially Commented Dec 15, 2019 at 23:01
  • Does adding the required modules via --add-modules to the VM options in the Javadoc wizard work? bugs.eclipse.org/bugs/show_bug.cgi?id=543405#c2 Commented Dec 16, 2019 at 0:38
  • @howlger Thanks for the suggestion, unfortunately it still doesn't work :/ I added --add-modules=javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,org.junit.jupiter.api,javafx.swing Commented Dec 16, 2019 at 11:51
  • Exactly the same error message? Do you use Eclipse 2019-09 (4.13)? Commented Dec 16, 2019 at 12:08

2 Answers 2

1

I have found temporarily deleting thee module-info.java file, generating the JavaDocs then hitting undo to bring the module-info.java back works.

This is a quick fix, but Eclipse really needs a little button on the JavaDoc wizard to disable linting.

Sign up to request clarification or add additional context in comments.

Comments

1

The problem seems to be a long standing problem in Eclipse that's been there since Java 9 was supported and JavaFX became an independent module external to the Java SDK.

The problem is that Eclipse does not automatically pass information related to the JavaFX module to the JavaDoc call. I guess if it had to do that for each module their users might commonly employ, this would be an impossible task for Eclipse's developers.

Thankfully we can do it by ourselves. Using the third screen of the JavaDoc wizard (clicking next twice) allows us to specify VM options. Add the following and change the path to where your JavaFX is installed.

--module-path "C:\Java\javafx-sdk-13.0.1\lib"

You should find after this your JavaDocs generate without the aforementioned error being raised. I just tried this in my 2021-06 version and it works, I have used this solution in prior versions too.

2 Comments

This worked for me in one case but not for Junit. I'm sure it's something I do not understand but for the life of me I cannot figure it out. for Junit I can only work around the issue by temporarily deleting the modules-info.java doc, then restoring it.
@smaxwell, there is probably somthing you can indlude in module-info.java, what it is though I'm not sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.