I am not sure whether you can do it using java or not but the same thing can be done in two way. 1)During production/development envn: Pass the argument to the JVM as java -DANTHOME=C:/C:/apache-ant-1.7.0 com.myapp.Main. Get the value in your program using System.getProperties("ANTHOME"); 2)Production envn: These variables can be set at the time of installation of your product with the help of package makers(InstallShield on windows) and shell scripts on Solaris/Linux.
To adjust the Windows (or any O/S) system configuration, which includes environment variables, you cannot use 100% pure Java. You can change the environment of your Java process, or any processes spawned by it, but that does not sound like what you want to do.
Your choices are (a) native code, using JNI, or (b) executing some external program using Runtime.exec(). You might be able to achieve (a) without writing any native code yourself, if you can find some that someone else has already written. [ January 19, 2007: Message edited by: Peter Chase ]
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.