I made this method to play audio in my class and it works fine. but for some reason when i export it to a jar file nothing happens. I tried other solutions but i just get null-pointer exceptions. does anyone have an idea what i'm doing wrong
public void welcome(){
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("sound/garage1.wav").getAbsoluteFile());
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.start();
} catch(Exception ex) {
System.out.println("Error with playing sound.");
ex.printStackTrace();
}
}