title: Java Music File returns "(No such file or directory)" but path seems correct
body: <p>I'm working on a Java game project right now, and I'm trying to import music. However, I can't seem to get it working:</p>
  <pre><code>import java.io.File;
  
  import javax.sound.sampled.AudioInputStream;
  import javax.sound.sampled.AudioSystem;
  import javax.sound.sampled.Clip;
  
  public class Music {
  
  public static void playSound(String name) {
      try {
          
          System.out.println(&quot;music is now playing&quot;);
          File file = new File(&quot;audio/&quot; + name + &quot;.wav&quot;);
          AudioInputStream stream = AudioSystem.getAudioInputStream(file);
          Clip clip = AudioSystem.getClip();
          clip.open(stream);
          clip.start();
  
          // sleep to allow enough time for the clip to play
          Thread.sleep(10);
  
          stream.close();
  
      } catch (Exception ex) {
          System.out.println(ex.getMessage());
      }
  }
  
  }
  </code></pre>
  <p>The above is my code for my <strong>music.java</strong> class, which is then called in my main <strong>game.java</strong> class.</p>
  <pre><code>public static void main(String[] args) {
      // instantiate this object
      Music.playSound(&quot;ahem&quot;);
      Game game = new Game();
  
  
  } // main
  </code></pre>
  <p>But my output returns</p>
  <pre><code>music is now playing 
  audio/ahem.wav (No such file or directory)
  </code></pre>
  <p>I'm fairly certain that my .wav file is placed in the right spot (in an &quot;audio&quot; folder inside my &quot;bin&quot; folder, so I'm not sure what's going on.</p>