I know you can get the currently logged in user name (in windows or unix) by doing System.getProperty("user.name"). But how exactly is this variable set? Is it set by a system env variable (in unix)? So for example, if I am launching a new process with Runtime.exec("myJavaCommand"). Is it possible to change the user.name variable for that spawned process? Any ideas? Thank you!
I'm not sure you can do it before-hand, if the new JVM is setting the user.name property from the system's environment. I'm curious about why you need to do this; it seems simpler to me to just manage an internal property.