title: Java: store configuration variables in a file
body: <p>I'm developing a program with NetBeans 8.0 and JavaFX Scene Builder 2.0 that need store some variables in a file, where admin users can modify it when needed, (like change server IP address, or a number value from a no editable textfield) and if they close and load again the program, the changes made in variables are kept. Like any settings section of a program.</p>
  
  <p>I just try do it with the <code>Properties</code> file, but i have problems to store it in the same folder as .jar file. When the program execute the line <code>new FileOutputStream("configuration.properties");</code> the file is created at root of the disk. As the folder of the file can be stored anywhere, i not know how indicate the right path.</p>
  
  <p>Creating the properties file in the package of the main project and using <code>getClass().getResourceAsStream("configuration.properties");</code> i can read it but then i can not write in for change values of variables.</p>
  
  <p>Is there a better method to create a configuration file? Or properties file is the best option for this case?</p>
  
  <p>My other question is whether it is possible to prevent access to the contents of the file or encrypt the content?</p>
  
  <p>PD: I've been testing this part of the code in Linux operating system currently, but the program will be used in Windows 7 when ready.</p>