title: How do you properly include a resource folder in a JAR artifact in IntelliJ IDEA?
body: <p>I have a project that reads graphics and sound effects from a folder labeled res. This folder is at the same directory level as the src folder. I have res marked as Resources Root. </p>
  
  <p>I configured my artifact to include res as a Content Directory by way of 
  Project Structure -> Artifacts -> Add (Alt + Insert) -> JAR</p>
  
  <p>Then, in the output layout tab, I pressed the Add dropdown box -> Directory Content -> res</p>
  
  <p>When I run the project in Intellij, it finds the resources just fine. Here is a code snippet showing how I access the resources:</p>
  
  <pre><code>public static final Sfx VOID_SOUND = new Sfx(TinySound.loadSound(new File("res/audio/sfx/void_sound.wav")));
  </code></pre>
  
  <p>However, when I build the standalone artifact, then run the jar, it looks for the resource by prepending the parent directory of my machine to the file path, all the way to root. Here is how the terminal output looks:</p>
  
  <pre><code>/home/user/Demo/res/audio/sfx/void_sound.wav (No such file or directory)
  Error getting resource stream!
  </code></pre>
  
  <p>Is there a way to configure the artifact build to where it looks in the proper place? I want the resources included inside the jar file so it acts as a standalone jar with no external dependencies.</p>