title: How to play a sound file in java from src
body: <p>I have an mp3 file that i am trying to play from a source package in eclipse (java) for some reason it plays fine when i run it in eclipse but when i try to play it from a .jar it doesn't play. The images show up fine but the sound doesn't, i think i may have to recode the sound file like an image file but i'm not sure how here's the code for the Image:</p>
  
  <pre><code>JLabel TextBox = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/Images/TextBox.png"))));
  </code></pre>
  
  <p>and the Sound</p>
  
  <pre><code>Player player = Manager.createPlayer(new MediaLocator(getClass().getClassLoader().getResource("Sounds/Bonsai.mp3")));
  </code></pre>
  
  <p>thanks in advance!</p>