Well, problem gets deeper, will try explain what I got...
I have work folder for my school project, there is a program which holds main function, then there is txt file which I will rewrite with new datas with each run of program. In same diredtory is folder with images, folder with other text files and package folder and manifest.
In order to create JAR file I used following command
jar cmf game.mf Game.jar *.class GamePackage/*.class Image/*.gif TextFile/*.txt
It created for me, jar with all stuff inside but it is only working if I keep it in original directory. If I move game.jar and "rewritable" txt to diferent directory my images get lost and the function which use other txt file will not work(close down application)
I am having the same problem reading a text file when my program gets packaged as a jar. The weird thing is that it has no problem finding a jpg image, it just can't find one txt file that is in the package. Do I really have to completely modify how I access the text file to get it to work in the jar package? Will it still work like normal too, or is this only for the jar package?
Yeah and you just reopened 5 years old thread, didn't read it all as original poster was me back at uni and then my post was hijacked few times. So yeah, I got my answer and other like you didn't bother to read it all