Answer the question
In order to leave comments, you need to log in
How to connect JavaFX to a Maven project?
Hello.
Kills the question, how do I connect JavaFX to a Maven project. All attempts lead to a huge number of exceptions like NullPointer and ClassNotFound and refers to 1 line where an FXML file with markup is imported into the start() method.
Well, I'm really asking for help.
Answer the question
In order to leave comments, you need to log in
Oleg Genevjov : I'll try to be clairvoyant (through space and unwillingness to show at least a piece of code where fxml is loaded)
I'm almost sure that before connecting the link (address in the form of a string) to fxml was
If yes, then after connecting maven, you need to correct the *.fxml address, namely, add a slash to the beginning:
FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/blablabla/Some.fxml"));
You need to add a plugin to Maven
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>com.kutas.u.Main</mainClass>
</configuration>
</plugin>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question