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:
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); } But it doesn't seem to work. What am I doing wrong?