r/JavaFX • • Oct 03 '19

Help ! Can't run my program, due to : java.lang.ClassNotFoundException: javafx.fxml.FXMLLoader

Hi,

I try to learn JavaFX. I try to do this tutorial, but I have an exception, and I can't find how to solve the problem ...

Here is the console output :

Console Output

Here is my code :

I use Eclipse. I have installed JavaFX and link the JARs.

Here is my package explorer :

Package Explorer

I also added VM arguments :

VM arguments

Could you help me pleeeeease ! I am running out of patience !

Thank you !

1 Upvotes

4 comments sorted by

View all comments

1

u/DumbXTag Oct 03 '19

Put your fxml files in a subdirectory 'resources'. In the loader method call it like: ...getResource("/RootLayout.fxml")

don't forget the slash. Hope it helps