I know this question has been asked before, but I couldn't actually understand the solution to the problem, that's why I'm posting my code specifically!
When I run the program from netbeans the music is just fine. However, when I run it from the jar file, the program is executed smoothly, but without music.
I used this code to play music: http://www.anyexample.com/programming/java/java_play_wav_sound_file.xml
And I call the function like this in GUI class:
musicPlayer = new AePlayWave("src/songs/Full_Despicable_Me_Theme_Song_-_Pharrell_Williams.wav");
musicPlayer.start();
(as you can see I have a package called "songs", which contains the song)
Hope you can help!