I've been searching for quite a while on why I kept getting this error even though the path to my image was set correctly.
In IntelliJ, right click on your "resources" folder and press "Mark directory as" > "Resources root"
Then, when referring to your image, you can use this code:
Image myImage = new Image("myImage.jpg");
As you can see, this appeared to be set up correctly, but somehow that still gave me this error.
Edit: This is not a question on how to get the correct file path, as the file path is correct. It's more a question (& answer) on how to resolve this build error. Therefore the duplicate is invalid in my opinion.