I have problem with playing sounds in my java application. Sound is playing when user get message. Everything is working on OS X but on Windows it doesn't. I put file to jar using this command: jar uf client.jar getMsgSound.wav . I suppose that the problem is with find this file.
public String soundName = "getMsgSound.wav";
public void playSound()
{
try {
File soundFile = new File(soundName);
AudioInputStream audioIn = AudioSystem.getAudioInputStream(soundFile);
Clip clip = AudioSystem.getClip();
clip.open(audioIn);
clip.start();
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (LineUnavailableException e) {
e.printStackTrace();
}
}