I need to find my documents path using Java. The following code doesn\'t give me \"accurate\" loation
System.getProperty(\"user.home\");
What sh
Since the most upvoted answer from @xchiltonx uses JFileChooser I would like to add that, regarding performance, this is faster than using JFileChooser:
FileSystemView.getFileSystemView().getDefaultDirectory().getPath()
In my PC, JFileChooser aproach needed 300ms, and calling FileSystemView directly needed less than 100ms.
Note: The question is a possible duplicate of How to find “My Documents” folder in Java