title: How do I use the Java ClassLoader to load a file fromthe classpath?
body: <p>I want to use the ClassLoader to load a properties file for the Properties class. I've simplified the below code to remove error handling for the purposes of this discussion:</p>
  
  <pre><code>loader = this.getClass().getClassLoader();
  in = loader.getResourceAsStream("theta.properties");
  result = new Properties();
  result.load(in);
  </code></pre>
  
  <p>In the same directory as this class I have the file "theta.properties" but the InputStream is always null. Am I putting the file in the wrong place? I'm using eclipse and its set to build the class files to the source folder - so that shouldn't be the problem. </p>
  
  <p>I can't find anything in the JavaDoc to get the ClassLoader to tell me what classpath is being searched. </p>