That makes sense though because you'll effectively be saying:
File errorSoundFile = new File("/com/my/example/gui/resources/Error.wav");
Now depending on where you're starting from it's probably not going to be the correct path to the file. So you need to have a path that is correct from where you are making the call and/or have a defined prefix/context root to start from
e.g. File errorSoundFile = new File(CONTEXT_ROOT + myResourceMap.getString("myError.wav”));
The subtle difference here is that you'd be bringing back a string from the ResourceMap (no context, it's not actually a lookup resource, think of it purely as a property in a property file) and using that string to try and create a new File, which has no knowledge of the context that ResourceMap does.
If a myResourceMap.getFile() was provided then you'd be actually using the ResourceMap and its inherent context to get the file, but I'm guessing the API doesn't provide that.
Hmm, actually I've just realised this is all Swing stuff right? Let me send you to that forum so the relevant experts can cast an eye on it (my Open Source project developers would laugh if they saw me trying to give Swing advice ;p)
If I understand the problem correctly, your WAVE file is a resource, possibly located inside your JAR file.
If so, use getResourceAsStream to retrieve an InputStream to it, and write it to a temporary file. File has some methods for creating unique temporary files. If you also call deleteOnExit() on that temporary file you will leave little to no "garbage".