Basically, I have to overwrite a certain property in a .properties file through a Java app, but when I use Properties.setProperty() and Properties.Store() it overwrites the
You can use PropertiesConfiguration from Apache Commons Configuration.
In version 1.X:
PropertiesConfiguration config = new PropertiesConfiguration("file.properties");
config.setProperty("somekey", "somevalue");
config.save();
From version 2.0:
Parameters params = new Parameters();
FileBasedConfigurationBuilder builder =
new FileBasedConfigurationBuilder(PropertiesConfiguration.class)
.configure(params.properties()
.setFileName("file.properties"));
Configuration config = builder.getConfiguration();
config.setProperty("somekey", "somevalue");
builder.save();