I have just finished my first java project, however I can't seem to get it to build properly. It will load the initial fxml file that the whole calculator runs on, however when I try to add a holiday/break in the holiday/break menu a dialogpane is supposed to display so the user can fill information, but I keep getting a location not set error when I run the jar file in the cmd. It all works when I launch it in intellij but not in the jar.
This is how I have my files set up. I made a resource directory in the FinishedCalCulator project and marked it as the resource root
This is how I set the Location of the FXML file into the loader. This works when I run it in Intellij but not in the jar file.
Invocation Target Exception/Location not set error

I have looked around and found a few posts talking about putting all of the fxml files into a resource file and I did that and got it working again in Intellij, but it still will not display the dialog panes when I try to add them. I'm not really sure what I am doing wrong here. I don't think I fully understand what I am doing wrong. Any help would be great.




AddHolidayDialog.fxmlyet you are searching for it withgetClass().getResource("/addHolidayDialog.fxml"). Notice the difference of case in the "A"? The "file system" of a JAR file is case sensitive. However, Windows' file system is not. Thus, it works when ran from Intellij but not from the JAR.getResourcemethod parameter and highlighting the occurances ofdialog. This info is unimportant to the question though. The stack trace should be posted as text (code block) too instead of a screenshot; it should be simple enough to redirect the error stream to a text file and copy&paste it to the question...