I\'m using java.util.Properties\'s store(Writer, String) method to store the properties. In the resulting text file, the properties are stored in a haphazard order.
As per "The New Idiot's" suggestion, this stores in alphabetical key order.
Properties tmp = new Properties() { @Override public synchronized Enumeration keys() { return Collections.enumeration(new TreeSet(super.keySet())); } }; tmp.putAll(properties); tmp.store(new FileWriter(file), null);