title: Java: load and edit properties file on classpath
body: <p>I would like to persist some properties to property-file in case they were changed during a program run. Now I am trying to do so:</p>
  
  <pre><code>Properties properties = new Properties();
  
      try (FileInputStream in = new FileInputStream("classpath:app.properties")) {
          properties.load(in);
      } catch (IOException e) {
          logger.error("", e);
      }
  
      properties.setProperty("word", "abc");
  
      try (FileOutputStream out = new FileOutputStream("classpath:app.properties")) {
         properties.store(out, null);
      } catch (IOException e) {
          logger.error("", e);
      }
  </code></pre>
  
  <p>But it doesn't seem to work. What am I doing wrong?</p>