How to get users home directory?

Showing 1-4 of 4 messages
How to get users home directory? Bryan 7/13/07 11:13 AM
Hi,

How in java do I find the users home directory?  I have an app that
needs to write some files to the current users Documents and Settings
directory on XP.

Thanks,
Bryan

Re: How to get users home directory? Carl 7/13/07 11:34 AM
Bryan <b...@nospam.net> writes:

Try:

String userHome = System.getProperty("user.home");

hope that helps,
Carl.

Re: How to get users home directory? Oliver Wong 7/13/07 11:48 AM

"Bryan" <b...@nospam.net> wrote in message
news:FhPli.6391$rL1.475@newssvr19.news.prodigy.net...

Use system properties. A list of available properties are at:
http://www.mindspring.com/~mgrand/java-system-properties.htm

    - Oliver


Re: How to get users home directory? Roedy Green 7/13/07 12:43 PM
On Fri, 13 Jul 2007 11:13:58 -0700, Bryan <b...@nospam.net> wrote,
quoted or indirectly quoted someone who said :

>How in java do I find the users home directory?  I have an app that
>needs to write some files to the current users Documents and Settings
>directory on XP.

see http://mindprod.com/jgloss/properties.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com