Hi,
Use this in Unix.
Runtime.getRuntime().exec("/bin/env").getInputStream());
Or use the set command in order to get the Environment variable in Windows.
Also you can use in java.util.Properties.
For eg in order to get the System Property foo.
String env = System.getProperty("foo");
I hope this will help you.
Thanks
Bakrudeen