afterburner.fx
afterburner.fx copied to clipboard
Leading slash in getResource()
I have migrated an app from Java 8 to 11 where afterburner.fx was working fine on 8. I have also used maven for all the deps. Now I cannot find the correct .fxml
resources, which are still in the same place as before.
Caused by: java.lang.IllegalStateException: Cannot load file Main.fxml
My project structure:
|_ src
|_ java
|_ <package>
|_ ui
|_ main
|_ main.fxml
|_ MainView.java
|_ MainPresenter.java
|_ main.css
pom.xml
After breaking into the debugger and snooping around a bit:
getClass().getResource("main.fxml"); // -> null, file not found
getClass().getResource("/main.fxml"); // -> this works, file found
It seems that the leading slash fixes the issues, is this some kind of change between java versions that I didn't spot?
Is this related to #75 ?