title: Image path reading which is in another package in java
body: <p>I have my java class in package <strong>hello</strong>/com/abc/xyz/Test.java</p>
  
  <p>In this <strong>"Test.java"</strong> file I am writing code to generate HTML. In which it contains image tag.something like</p>
  
  <pre><code>String str ="&lt;Table&gt;&lt;img src=""&gt;&lt;/img&gt;&lt;/table&gt;
  </code></pre>
  
  <p>My image is in another package as <strong>hello123</strong>/web/img/myImg.jpg.   </p>
  
  <p>How I can access this image in my Test.java file.</p>
  
  <p>if I hard code path like "c://myproject/hello123/web/img/myImg.jpg" its working. But this path will not be consistent in other places and other environments.</p>
  
  <p>I tried putting my image in same folder as my java file...not worked.</p>
  
  <p>Can any body help in this ?</p>
  
  <p>Thanks in advance.</p>