When I make a jar archive from my .class-files and the image and sound file I use in the program (all files in program root directory) and execute it, the image and sound are not loaded unless they are in the directory in which the jar-file is. That is, although they are inside the jar-file, they have to be in the same directory as the jar-file too.
I create the jar-file using (I’ve also tried . for the files to be included):
jar -cmf manifest.mf game.jar *.class image.gif sound.wav
And run it using (the program starts, only it doesn’t play the sound and doesn’t display the image):
java -jar game.jar
Anyone know what I’m doing wrong?