You actually deal with two files with the same name. One is located in the CLASSPATH. The class loader reads it in the method getResourceAsStream("myfile.properties"). The second file is created in the current working directory by the constructor FileOutputStream("myfile.properties"). The first file isn't updated because the value is changed in the second file.
Joined: Feb 23, 2013
Yup, That's what happening! It works fine if I use OutputStream and InputStream everywhere.