FULL PRODUCT VERSION :
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
any Windows of the NT branch I guess
EXTRA RELEVANT SYSTEM CONFIGURATION :
my "Desktop" and "My Documents" folders are not in the default location
A DESCRIPTION OF THE PROBLEM :
Instead of returning something useful like %USERDATA% or even something better like %APPDATA%\Java the function returns something weird I can't even express with system variables.
It returns the parent directory of "My Documents" or "Desktop" which doesn't even have to do anything with the user.
My example: (where DaS means "Documents and Settings"):
C:\DaS\user <-- my user profile folder
C:\DaS\user\Application Data\Java <-- a good location for user.home
D:\ <-- this is what user.home returns
D:\My Documents <-- my "My Documents" folder
D:\Desktop <-- my "Desktop" folder
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- change My Documents and Desktop folders
- call System.getProperty("user.home")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"%USERPROFILE%" or even "%APPDATA%\Java"
ACTUAL -
"'My Documents'\.." or "'Desktop'\.."
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Userhome {
public static void main(String[] args) {
System.out.println(System.getProperty("user.home"));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
getting the real directory from the registry or environmental variables
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
any Windows of the NT branch I guess
EXTRA RELEVANT SYSTEM CONFIGURATION :
my "Desktop" and "My Documents" folders are not in the default location
A DESCRIPTION OF THE PROBLEM :
Instead of returning something useful like %USERDATA% or even something better like %APPDATA%\Java the function returns something weird I can't even express with system variables.
It returns the parent directory of "My Documents" or "Desktop" which doesn't even have to do anything with the user.
My example: (where DaS means "Documents and Settings"):
C:\DaS\user <-- my user profile folder
C:\DaS\user\Application Data\Java <-- a good location for user.home
D:\ <-- this is what user.home returns
D:\My Documents <-- my "My Documents" folder
D:\Desktop <-- my "Desktop" folder
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- change My Documents and Desktop folders
- call System.getProperty("user.home")
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
"%USERPROFILE%" or even "%APPDATA%\Java"
ACTUAL -
"'My Documents'\.." or "'Desktop'\.."
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Userhome {
public static void main(String[] args) {
System.out.println(System.getProperty("user.home"));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
getting the real directory from the registry or environmental variables