More Jar Help: Reading Audio Files
Posted on 2004-11-07
I've defined a class SoundEffects that generates AudioClip references.
Public class SoundEffects
String path = "audio/";
public AudioClip getAudio(String file)
return Applet.newAudioClip(getClass().getResource(path + file));
public void setPath(String string)
path = string;
Now this works fine and my program works fine. The problem is that now I want to put
everything into an executable jar file. However, on attempting to execute the jar file:
c:\>java -jar program.jar
I get the error message:
Exception in thread "main" java.lang.NullPointerException
Basically , it's saying it can't find the audio files.
Why and how do i reslove this?