Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » JavaFX library not appearing in Command Line(Should a library listed in the module path automatically appear in the run configuration dependencies?)
JavaFX library not appearing in Command Line [message #1841834] Mon, 31 May 2021 18:35 Go to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
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:
http://adonax.com/images/javafxLibEclipse.jpg

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 #1842050 is a reply to message #1841834] Tue, 08 June 2021 08:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I think the following step in the tutorial is wrong:
Quote:

Make sure JDK 11 or greater is selected. You don't need to add a module-info.java file. You can include the JavaFX15.0.1 library into the classpath

You should not add that library to the classpath but to the modulepath!
Re: JavaFX library not appearing in Command Line [message #1842082 is a reply to message #1842050] Tue, 08 June 2021 17:01 Go to previous messageGo to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
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

Re: JavaFX library not appearing in Command Line [message #1844363 is a reply to message #1842082] Fri, 10 September 2021 17:55 Go to previous messageGo to next message
Arthur Chan is currently offline Arthur ChanFriend
Messages: 3
Registered: March 2020
Junior Member
Error: JavaFX runtime components are missing, and are required to run this application
Which runtime components?

In the project user library, I have following (UserLib.jpg)
index.php/fa/40958/0/

And in the Java build path, I have these (JBuildPath.jpg)
index.php/fa/40960/0/

How do I find pout exactly what Eclipse is missing?
  • Attachment: UserLib.JPG
    (Size: 82.04KB, Downloaded 2215 times)
  • Attachment: JBuildPath.JPG
    (Size: 25.52KB, Downloaded 2068 times)
Re: JavaFX library not appearing in Command Line [message #1844365 is a reply to message #1844363] Fri, 10 September 2021 18:37 Go to previous messageGo to next message
Phil Freihofner is currently offline Phil FreihofnerFriend
Messages: 47
Registered: May 2010
Member
I think you are guaranteeing yourself problems by using Java SE 1.8, which is non-modular, with modular JavaFX.

I also think you'd be best advised to use JavaFX within a Maven Project. I'm finding this much easier to configure. Maven is not a hard pickup--there are several good tutorials around for using Maven with Eclipse.

I kindly request that you post your questions on your own thread. The question you posed here does not pertain to the original question.
Re: JavaFX library not appearing in Command Line [message #1845008 is a reply to message #1844365] Sat, 02 October 2021 15:39 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I fully agree with Phil don't try to mess with setting things up manually (unless you are doing that to integration in an Eclipse/OSGi Application)
Previous Topic:Eclipse won't start after installing e(fx)clipse
Next Topic:HowTo ???
Goto Forum:
  


Current Time: Fri Apr 19 08:52:56 GMT 2024

Powered by FUDForum. Page generated in 0.05845 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top