title: Why does getResource return null
body: <p>I'm trying to access a file in my project. But getResource method returns null.</p>
  
  <p>This is how my project looks like:
  <img src="https://i.stack.imgur.com/sAScN.png" alt="enter image description here"> </p>
  
  <pre><code>Thread.currentThread().getContextClassLoader().getResource("assets/xxx.png"); //returns null
  </code></pre>
  
  <p>And how project folder in eclipse workspace looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/ywcui.png" alt="enter image description here"></p>
  
  <p>Why? I want to access files in my assets folder?</p>
  
  <p><strong>Edit</strong>
  I created a jar file and this is content of the jar:</p>
  
  <p><img src="https://i.stack.imgur.com/cW7IZ.png" alt="enter image description here"></p>
  
  <p><strong>Solved</strong></p>
  
  <p>First of all, I've a lot of image files so I want to organize all them in a folder. I put the assets folder in src directory and finally I was able to access the files.</p>
  
  <pre><code>this.getClass().getClassLoader().getResource("assets/xxx.png");
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/HHzsg.png" alt="enter image description here"></p>