title: Java relative path in NetBeans
body: <p>I am developing a NetBeans module where I have a Java package called <code>test</code>and another package called <code>test.templates</code>. I want to read a text file which is in the <code>test.templates</code> package from a Java file in the test package. I tried in several ways, but it gives a <code>FileNotFoundException</code> exception:</p>
  
  <pre><code>BufferedReader br = new BufferedReader(new FileReader("templates/test.txt"));
  BufferedReader br = new BufferedReader(new FileReader("/test/templates/test.txt"));
  BufferedReader br = new BufferedReader(new FileReader("src/test/templates/test.txt"));
  </code></pre>
  
  <p>But none of these worked.. I want to use the relative path, not the absolute path. What should I do?</p>