title: Alternatives to AppData (Windows) when storing files on other OS
body: <p>I'm working on a game project in Java and I need to store the <code>config.ini</code> file somewhere other than the executable <code>jar</code> location. I know people usually save them inside <code>AppData</code> on Windows, but I'd like to make my game completely portable with no OS restrictions at all. But to do so, I would need to know where to store such file.</p>
  
  <p>I'd like to know where people usually store such files on other UNIX operational systems, mainly Ubuntu or Macintosh (OS X).</p>
  
  <p>I'd also would appreciate if you could explain me a bit more about the directories regarding such OSs, since I do not own any of these systems. What I mean by that is, for instance, in Windows people usually drop their applications on their Desktops, while Mac users put them inside an Applications folder. In Mac's case, would creating a folder inside that Application directory be as bad as creating a folder on a Windows Desktop?</p>
  
  <p>Also, on Ubuntu's case, where would the equivalent to AppData on Windows be located? And what about Mac's case? Would saving screenshots of the game or creating save games inside <code>AppData</code> or equivalents be a bad idea? I don't really want to use the usual <code>Program Files</code> directory.</p>
  
  <p>And finally, a more code-wise issue. I know that in Java you can get Window's AppData location and concatenate such path like the below code:</p>
  
  <p><code>Path FOO = Paths.get(System.getenv("AppData"), "BAR");</code></p>
  
  <p>What about Mac and Ubuntu? And how would I be able to check whether the user is using Windows or Ubuntu?</p>
  
  <hr>
  
  <pre>Thank you very much,
  -Renato</pre>