JavaFX library not appearing in Command Line [message #1841834] |
Mon, 31 May 2021 18:35 |
Phil Freihofner Messages: 47 Registered: May 2010 |
Member |
|
|
I'm wondering why Eclipse doesn't automatically include the JavaFX library that has been added to the module path (via the build configuration form) in the command line generated to run the program.
Here is how I came across the issue: I was following the Gluon Getting Started documentation for modular projects using Eclipse. Using it as a guide, I added the JavaFX 16 as a library in the Build Path (and was careful to add all the jars from the /lib folder. I was also careful to ensure the module-info.java file was correct.
But when attempting to run, the following error arises:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.graphics not found, required by hellofx
Inspecting the Run Configurations, I see under the Dependencies tab that the JavaFX library fails to appear in the list. Other members of the Build Configuration->Library->ModulePath are all there. Shouldn't the JavaFX library also be listed here?
Inspecting the generated command line from Run Configurations, there is no reference to the folder that holds the JavaFX jars. I'm assuming it should appear as either a --module-path or -p option. We are told that there is no longer a need to include VM arguments, if we have a module-based project. I assumed from that the dependencies would be handled automatically.
As a workaround, I can manually add the /lib folder for the JavaFX jars in the run configuration's Dependencies. After doing so, the folder shows up in the -p option of the generated command line. But is this really intended to be a required step? The Gluon tutorial doesn't list it as a step. Or am I doing something else wrong or overlooking something?
FWIW, here is a screenshot of how the JavaFX library appears in the Build Configuration section:
Any clarification on this would be helpful. If we are expected by the authors of this functionality to manually do this step, I'd like to follow up with Gluon to let them know to correct or update their tutorial accordingly. There are scads of us that have run into this problem, as evidenced by multiple unanswered requests for help on this issue in StackOverflow.
[Updated on: Mon, 31 May 2021 23:55] Report message to a moderator
|
|
|
|
Re: JavaFX library not appearing in Command Line [message #1842082 is a reply to message #1842050] |
Tue, 08 June 2021 17:01 |
Phil Freihofner Messages: 47 Registered: May 2010 |
Member |
|
|
Thanks for the reply. I think you are right and this should also be fixed: the /lib folder of the jdk for JavaFX should be specified on the module path, not the class path.
However, even after doing so, Eclipse is NOT adding this item to the generated command line. It seems to me this is an error or oversight on the part of the Eclipse application, which is why I am bringing the issue up in this forum, in addition to writing Gluon directly about the section.
P.S. I'm unable to identify the location of middle sentence of your quote: "You don't need to add a module-info file." When I look at the selection in my browser, the sentence reads as follows: " Verify you have selected the option to create a module-info.java file, and select the output folder as HelloFX/bin/hellofx." But I guess it amounts to the same thing: if one checks the box to automatically create the module-info file, there is no need to manually add it in.
[Updated on: Tue, 08 June 2021 17:03] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04712 seconds