How can I get system user documents, pictures, music folders independent of OS using Java?
问题 While I was working on my project I received a requirement: I need to get the system user documents folder (like “My Documents” for Windows and “Documents” for Linux and Mac OS X). I need to get it for all the operating systems. How can I do this? I can get the user root directory by using System.getProperty("user.home") . I need a solution for this requirement using Java. 回答1: The location of the default system "Documents" or "Pictures" folder is highly operating-system dependent,