Can I get system enviroment variable values in Java Programm

Can I get system enviroment variable vlues in Java Programm.For example I set a enviroment variableMy_Home=c:\myhome.Do I have ways to get My_Home in Java Programm.
[185 byte] By [realwxd] at [2007-9-26 2:41:32]
# 1
RTFM. {getProperty(), getproperties()} http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html
walpj at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 2
Hi,I read the properties but I can not get the My_Homevariable.Could you give me a little programm to realize this?
realwxd at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 3

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

bakrudeen_indts at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 4
Hi Thank you.But In windows2000 it does not work?
realwxd at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 5
Environment variables are defined per-shell. And the JVM reads the existing values on startup and doesn't dynamically update them if they change. Could either of these traits relate to your problem?
walpj at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 6
Hi,Have you tried using the "set" command, which I have given for windows.ThanksBakrudeen
bakrudeen_indts at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...
# 7
Yes.But it lists all env variables.It is hard to get one of them values.
realwxd at 2007-6-29 10:17:15 > top of Java-index,Desktop,Runtime Environment...