Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Someone Please help!(Could not find or load main class javafx.controls,javafx.fxml)
Someone Please help! [message #1826414] Fri, 24 April 2020 14:47 Go to next message
Scott Frizzell is currently offline Scott FrizzellFriend
Messages: 2
Registered: April 2020
Junior Member
In the last number of weeks I have been learning Java, or at least trying to. The problem is the course had major compatibility issues with getting 'Windows Builder' ,'JavaFX', and 'SceneBuilder' work work harmoniously with Eclipse.

After numerous attempts, my system suffered a failure and it was reset. Now I have been re-installing the software only this time I'm not trying to find 'version X' from 'Y months or years ago', I am using the latest releases. So to date I have installed:

Eclipse 2020-3

within Eclipse, I installed from Eclipse Marketplace:
e(fx)clipse 3.6.0

I added the path for the above JDK, javafx and jre bins to the variable and system paths under 'environment variables. I am running Windows 10 pro.

I have watched so many instruction videos I think I can almost quote them. I set up the build paths within Eclipse in accordance to direction. However, when I attempt to run a practice file identical to the ones shown in the 'how-to' videos I get:

Error: Could not find or load main class javafx.controls,javafx.fxml
Caused by: java.lang.ClassNotFoundException: javafx.controls,javafx.fxml

From the command prompt: java -version replies

java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) Client VM (build 25.251-b08, mixed mode)

Also from the command prompt: javac -version replies

java version 14.0.1

Please help! Where did I go wrong?

Re: Someone Please help! [message #1826449 is a reply to message #1826414] Sat, 25 April 2020 02:21 Go to previous message
Scott Frizzell is currently offline Scott FrizzellFriend
Messages: 2
Registered: April 2020
Junior Member
Okay! So I continued to try different things, hoping I missed something. I went into 'Run Configuration'. I then selected the 'Arguments' tab and then clicked into 'VM arguments'. I delete my entry that was there from earlier and re-entered it.
I entered:
--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules javafx.controls,javafx.fxml
I no longer get the error. What baffles me is that it is the exact same script I had there! In any event, it appears to work as advertised at the moment. Now to see if Windows Builder and or Scene Builder will co-operate!
Previous Topic:eGIT is throwing NullPointerException
Next Topic:Can't install Eclipse IDE 2020‑03
Goto Forum:

Current Time: Mon Feb 26 00:15:02 GMT 2024

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

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

Back to the top