title: The system cannot find the path specified in JAR
body: <p>I'm trying to play an audio file. In my IDE (intellij) that works completely fine, but when running in a JAR, I get the error <code>java.io.FileNotFoundException: D:\soni801\Documents\Redsea Productions\The Great X Wars\alpha-0.0.7.1.jar\audio\click.au (The system cannot find the path specified)</code></p>
  <p>The file's location inside the JAR is <code>audio/click.au</code>, and the JAR is located at <code>D:\soni801\Documents\Redsea Productions\The Great X Wars\alpha-0.0.7.1.jar</code> which afaik should make the absolute path <code>D:\soni801\Documents\Redsea Productions\The Great X Wars\alpha-0.0.7.1.jar\audio\click.au</code>, however the system can't find a file at this location? What's happening here?</p>
  <p>This is the code in my <code>AudioPlayer.java</code> file:</p>
  <pre class="lang-java prettyprint-override"><code>AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath() /*+ &quot;/res&quot;*/ + filePath).getAbsoluteFile());
  
  Clip clip = AudioSystem.getClip();
  clip.open(inputStream);
  </code></pre>
  <p>Alternatively, you can find the entire file, as well as the rest of the project, on the <a href="https://github.com/soni801/xwars/blob/master/src/com/xwars/main/AudioPlayer.java" rel="nofollow noreferrer">GitHub repository</a></p>
  <p>All help is appreciated.</p>
  <p><em>I am aware that this might be a duplicate of other questions, but unfortunately other solutions didn't solve my problem</em></p>
  <p><em>If the question is unclear, comment any improvements I could make, and I will edit the question</em></p>