I made a JavaFX app and part of that app is that every user has settings.json file to store his settings for the app. Right now I'm storing creating and storing this file at Documents/app_folder/settings.json using the following code:
String systemUser = System.getProperty("user.name");
FileWriter file = new FileWriter(
"/Users/" + systemUser + "/Documents/app_folder/"settings.json"
);
That one works fine only on English version of windows, on other language it doesn't work for obvious reason. Is there a way to get the system Documents folder by java code, or where should I create and store this file?
Thanks!