I had this same problem... The files were in my jar file, pathed as expected. The project ran fine from within the IDE (Intellij), but the Jar would fail to load some of my assets.
The problem was, my development workstation is a Windows machine, which isn't case-sensitive for directories and filenames, but the file-access mechanism Java uses to read files within the JAR is case-sensitive.
So, where I had "data/zones/dynamic/myart.png" which worked when running from the IDE, the JAR wouldn't work until I changed it to read "data/Zones/Dynamic/myart.png"... just those two capitalization errors made the resource un-findable... Folks who dev on Linux don't have that problem, since the whole system is case-sensitive, they're used to being careful about such things.
So, if your code can't find your assets when running from JAR, but the files are there, double-check the path/filename for correct-case.
Remember: It's easy to check contents of a jar, just rename it as .zip and open/extract.
Good luck!
files/WorldState1.txtin the classpath of your JAR file? Typejar -tvf your_jar.jarand see if it is there.Semesteroppgave.jar. Does it run?