can't find file in a jar
I have an mp3 file in my jar and I access it by doing:
FileInputStream fis = new FileInputStream("Track_4.mp3");
I know that this is the exact name of the file for two reasons:
1. It said it was in the verbose output when i created the jar.
2. I created a mini-test program with the same chunk of code and it worked.
The difference between the test-program and my real application is that the test program contained: Test.class Track_4.mp3 and MP3Player
The application's class that gets the stream for the mp3 is inside a bunch of folder:client/util/SoundControl.class
I put Track_4.mp3inside the util/ folder and it doesnt work!
java.io.FileNotFoundException: Track_4.mp3 (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at client.util.SoundControl.playMP3(SoundControl.java:109)
at client.util.SoundControl.playSoundtrack(SoundControl.java:104)
at client.battle.GameMaster.run(GameMaster.java:264)
Is there a way I can like find out what directory the FileInputStream is trying to load? or another solution?
THanks

