title: Getting a resource in a different project using classloader
body: <p>Using the ClassLoader#getResource(), I need to access a file that is present in a project other than the one where my current code resides. How can this be done?</p>
  
  <p>I'm using eclipse.</p>
  
  <p>Directory Structure:</p>
  
  <pre>
  Root  
  |-project1  
  | |-package  
  |   |-myResourceFile  
  |-project2  
    |-package  
      |-myCodeFile  
  </pre>
  
  <p>I'm trying to get myResourceFile from myCodeFile, using myCodeFile.class.getClassLoader().getResource("../../project1/package/myResourceFile") but its always returning null. I do not want to add project1 to the classpath of project2. Though adding that also did not work.</p>
  
  <p>With regards,</p>