title: Java - Loading External Properties File - FileNotFoundException
body: <p>I've written a class that loads external properties for use in my program, it is modeled off of this link: <a href="https://stackoverflow.com/questions/24962265/load-properties-file-in-singleton-class">Load Properties File in Singleton Class</a>. I've read here (<a href="https://stackoverflow.com/questions/21413938/filenotfoundexception-with-properties-file">FileNotFoundException with properties file</a>) and here  (<a href="https://stackoverflow.com/questions/4777252/java-properties-file-not-loading">Java Properties File not loading</a>) of how to load an external property file, however I continue to get a FileNotFoundException. My properties file is external and is located in the same directory as my executable jar.</p>
  
  <p>public class ExternalProperties extends Properties{</p>
  
  <pre><code>private static ExternalProperties instance = null;
  private Properties properties;
  private static String location;
  
  protected ExternalProperties() throws IOException {
      properties = new Properties();
      properties.load(getClass().getResourceAsStream("test.properties"));
  }
  
  public static ExternalProperties getInstance(){
      if(instance == null){
          try{
              instance = new ExternalProperties();
  
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
      return instance;
  }
  
  public static void setLocation(String path){
      location = path;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I am passing the location of the property file through the command line such as:</p>
  
  <p>java -jar chef-deploy-tests-0.0.0009-SNAPSHOT-jar-with-dependencies.jar test.properties</p>
  
  <p>Any suggestions on what I am doing wrong?</p>