title: Java eclipse error with exported runnable jar file
body: <p>I have a problem with an exported jar file.  When I run my project in Eclipse it runs fine, but when I run it as an exported jar from the console I receive the following error message: </p>
  
  <pre><code>java.io.FileNotFoundException: firstLaunch.properties (System can't find file)
  or
  java.io.FileNotFoundException: resources/config/firstLaunch.properties (System can't find file)
  </code></pre>
  
  <p>I tried to put it in to the resource folder and change syntax from <code>firstLaunch.properties</code> to <code>/resource/config/firstLaunch.properties</code>, but again it says the same thing but with a different path. I don't know why is this doing this.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public void saveConfigFile(String file, String key, String value) {
      Properties prop = new Properties();
      OutputStream output = null;
  
      try {
  
          output = new FileOutputStream(file);
  
          // set the properties value
          prop.setProperty(key, value);
  
          // save properties to project root folder
          prop.store(output, null);
  
      } catch (IOException io) {
          io.printStackTrace();
      } finally {
          if (output != null) {
              try {
                  output.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
      }
  }
  </code></pre>
  
  <p>My syntax for executing the method is</p>
  
  <pre><code>if (properties.loadConfigFile("firstLaunch.properties", "value").equals(properties.loadConfigFile("true.properties", "true"))) {
          properties.saveConfigFile("port.properties", "port", "8795");
          properties.saveConfigFile("ip.properties", "ip", temp[1]);
          properties.saveConfigFile("firstLaunch.properties", "value", "false");
          settings.port = properties.loadConfigFile("port.properties", "port");
          settings.myIp = properties.loadConfigFile("ip.properties", "ip");
      } else {
          settings.port = properties.loadConfigFile("port.properties", "port");
          settings.myIp = properties.loadConfigFile("ip.properties", "ip");
      }
  </code></pre>