Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get users home directory?

1,744 views
Skip to first unread message

Bryan

unread,
Jul 13, 2007, 2:13:58 PM7/13/07
to
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

Carl

unread,
Jul 13, 2007, 2:34:52 PM7/13/07
to
Bryan <b...@nospam.net> writes:

Try:

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

hope that helps,
Carl.

Oliver Wong

unread,
Jul 13, 2007, 2:48:30 PM7/13/07
to

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

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

- Oliver


Roedy Green

unread,
Jul 13, 2007, 3:43:49 PM7/13/07
to
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

0 new messages