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



The information in this article applies to:

  • Microsoft virtual machine
  • Microsoft SDK for Java 2.02
  • Microsoft SDK for Java 3.0
  • Microsoft SDK for Java 3.1

This article was previously published under Q177181

SYMPTOMS

When calling System.getProperty("user.home") the Java Virtual Machine (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 Windows 95, Windows 98, or Windows NT installation), no matter which directory you set the HOME environment variable to.

REFERENCES

For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:6/14/2006
Keywords:kbprb KB177181