Microsoft KB Archive/177181

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

Article ID: 177181

Article Last Modified on 6/14/2006

-

APPLIES TO


 * Microsoft Java Virtual Machine
 * Microsoft Software Development Kit for Java 2.02
 * Microsoft Software Development Kit for Java 3.0
 * Microsoft Software Development Kit 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 " \java" whether or not you set the HOME environment variable.



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 \java (where is the location of your Windows 95, Windows 98, or Windows NT installation), no matter which directory you set the HOME environment variable to.

