title: Java: How to I change the configuration file value in Java easily?
body: <p>I have a config file, named config.txt, look like this.</p>
  
  <pre><code>IP=192.168.1.145
  PORT=10022
  URL=http://www.stackoverflow.com
  </code></pre>
  
  <p>I wanna change some value of the config file in Java, say the port to 10045. How can I achieve easily?</p>
  
  <pre><code>IP=192.168.1.145
  PORT=10045
  URL=http://www.stackoverflow.com
  </code></pre>
  
  <p>In my trial, i need to write lots of code to read every line, to find the PORT, delete the original 10022, and then rewrite 10045. my code is dummy and hard to read. Is there any convenient way in java?</p>
  
  <p>Thanks a lot !</p>