ProcessBuilder setting user.home

Hi,

I'm trying to set "user.home" for a subprocess, started by ProcessBuilder:

// l is my command list

ProcessBuilder pb = new ProcessBuilder(l);

Map<String, String> environment = pb.environment();

environment.put("user.home", "C:\\Temp\\Foo");

System.out.println(System.getProperty("user.home"));

Process p = pb.start();

is not working..(I'm still seeing C:\Documents and Setings\<username> rather than C:\Temp\Foo

However, if I do a System.setProperty("user.home", "C:\\temp\\Foo"); from within the subprocess, it works fine..

am I doing something stupid?

[639 byte] By [orpheana] at [2007-11-27 6:45:38]
# 1
How does putting a value into the map of an independent process environment variables get that value into the set of System properties? They are not connected in any way. Even if they were connected, the environment variable name would be HOME not user.home.What are you trying to
sabre150a at 2007-7-12 18:17:38 > top of Java-index,Java Essentials,Java Programming...
# 2
how about this, add this as a jvm param to your command which you execute:-Duser.home=c://foo
mkoryaka at 2007-7-12 18:17:38 > top of Java-index,Java Essentials,Java Programming...