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

[1276 byte] By [Nethera] at [2007-11-27 3:53:45]
# 1
I'm not sure I understand what you're describing. If the mp3 is an entry in a jar, then it's not a file at all. Use Resources to load it (as in, Class.getResourceAsStream).
paulcwa at 2007-7-12 8:57:49 > top of Java-index,Java Essentials,Java Programming...
# 2
It works, Thanks a bunch!Why isnt an mp3 a file?This method seemed to work for images and midi.
Nethera at 2007-7-12 8:57:49 > top of Java-index,Java Essentials,Java Programming...
# 3
It's not a matter of it being an mp3, it's a matter of it being in a jar. java.io.File* doesn't apply to stuff in jar files. (The jar is the file, not its contents.)
paulcwa at 2007-7-12 8:57:49 > top of Java-index,Java Essentials,Java Programming...