0

I am designing a (farly big) application for a company. With this application the users can generate content in the form of XML documents, which they might want to share among each other.

It might seem like a trivial question at first, but I need a default location when the user clicks the Save As button. Unfortunately there are different operating systems and I haven't worked with all of them, so I don't know what is a common thing to do. The .jar could be executed from anywhere and the current execution directory doesn't seem like a professional solution. Neither does the desktop. Is there a way to get a proper system depended location I could use? On windows C:/Program Files/APPLICATION_NAME or C:/Users/USER/AppData/APPLICATION_NAME is often used. In my research I also stumbled upon C:/Documents And Settings/All Users/Application Data/

Neuron
  • 5,141
  • 5
  • 38
  • 59
  • `System.getProperty("user.home")` would give you a String of the current Users home directory (windows, linux, os x). Take a look here for further information [System Properties](https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html) – Nico T Aug 08 '16 at 12:36
  • Thanks! This is a step into the right direction, although I don't feel like I just just cram things into the users home dir. So where would I go from there? I am a little too afraid to just create new folders, as I want to find a professional solution! Thanks – Neuron Aug 08 '16 at 12:44
  • Okay , why dont you pass the directory as inputs to the jar ? anyhow its gonna used in all the platforms . I guess you should be able to handle about getting the default File System info in JAVA .[Refer](http://stackoverflow.com/questions/3548775/platform-independent-paths-in-java) – thar45 Aug 08 '16 at 12:50

0 Answers0