title: defining root classpath for class.getResource()
body: <p>I'm using java in Eclipse (windows), and I'm trying to use:</p>
  
  <pre><code>myClass.getResource("/image.jpg"), 
  </code></pre>
  
  <p>While image.jpg exists in the root loacation "myProject/". It returns null.</p>
  
  <p>I checked many other threads but none of them resolved my issue.</p>
  
  <p>So I tried to evaluate this:</p>
  
  <pre><code>this.getClass().getResource("/").getPath();
  </code></pre>
  
  <p>and it returned "myProject/build/classes".</p>
  
  <p>So I checked the project's configuration for this dir, and found the exact same dir under</p>
  
  <p>Java Build Path --> Source --> Default output folder</p>
  
  <p>My questions are: </p>
  
  <ol>
  <li><p>why is the default dir of my resources is the output folder?</p></li>
  <li><p>As mentioned, I want to get a resource from another folder, but attempts to call "/../" aren't working... How can I then load other resources which are not nested in my classes dir? (I can change my output dir, but I think it will be very ugly...)</p></li>
  </ol>