Microsoft SDK for Java

Q221206 BUG: System.getProperty("user.home") Returns Java Home Directory

The information in this article applies to:

SYMPTOMS

According to the documentation, System.getProperty("user.home") should return a String containing the user's home directory. Instead, the Microsoft VM returns the Java home directory, which is also returned by a call to System.getProperty("java.home").

RESOLUTION

While there are no known pure Java workarounds, there are a couple of things to try using Win32® code. To get the user's home directory, you could do the following:

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.