Bart Cremers said:
As said, the user.home property points to the parent of the desktop
directory on windows. The platform dependent way application
programmers should resolve the real user profile directory for windows
(note profile, not home) is through System.getEnv("USERPROFILE").
But using this requires application programmers to write some code to
determine the platform. And therefore they use
System.getProperty("user.home") instead which could be stated as
returning a buggy value. I would not say it's a bug, it just a decision
Sun has made to make the user.home property available on all platforms
in all circumstances.
From the javadocs at
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties(),
the "user.home" property is said to be "User's Home Directory".
I don't know the Win32 platform well enough to know if this is the case,
but if "User's Home Directory" has well defined semantics on the Win32
platform, and if it is not the same as what System.getProperty("user.home")
returns, then I think that is a bug. On the other hand, if the platform
doesn't really define a "User's Home Directory", then I'd say Sun is has
some freedom to returning whatever they want.
So it all depends on whether "User's Home Directory" actually means
something on Win32 or not.
- Oliver