Microsoft SDK for Java

Q177181 PRB: System.getProperty("user.home") Returns Incorrectly

The information in this article applies to:

SYMPTOMS

When calling System.getProperty("user.home") the Microsoft VM ignores the HOME environment variable value. It always returns %Windir%\java whether or not you set the HOME environment variable.

MORE INFORMATION

Steps to Reproduce Behavior

Create a Java project and include the following class to it:

   class TestProperty
   {

      public static void main(String args[])
      {
         System.out.println(System.getProperty("user.home"));
      }

   }

This always returns %Windir%\java (where %Windir% is the location of your Microsoft® Windows® 95, Microsoft® Windows® 98, or Microsoft® Windows NT® installation), no matter which directory you set the HOME environment variable to.

REFERENCES

For the latest Knowledge Base articles and other support information on Microsoft® Visual J++® and the SDK for Java, please see the following pages on the Microsoft Technical Support site:

http://support.microsoft.com/support/visualj/ This link takes you to a site on microsoft.com

http://support.microsoft.com/support/java/ This link takes you to a site on microsoft.com

Additional query words:

System properties home

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