How to accesss user defined environment variables

Hi all, I am trying to access user defined system variables. But i cant.I used System.getProperty() function but it returns null.Also getEnv() not working.I am using JAVA1.4.2_12?Please suggest something for me?Thank.Vinayak
[287 byte] By [VinuRocksa] at [2007-11-27 6:41:08]
# 1
execute your java program like the following:java -DparamName=paramValue myJavaProgramYou can access the environment variable like the following:System.getProperty("paramName");
java_2006a at 2007-7-12 18:10:37 > top of Java-index,Desktop,Runtime Environment...
# 2

Thanks for your reply

But i want to access a environment variable WS_HOME which is my tomcats WEB-INF/ws directory, and i want value of this variable through program

When i use System.getProperty("WS_HOME"), it returns null.

But for PATH variable when i write System.getProperty("java.library.path") , it returns the correct value.

What value should i give , so that it will give me the correct value of WS_HOME.

Please reply,

I need this thing immediaty.

Thanks,

Vinayak

VinuRocksa at 2007-7-12 18:10:37 > top of Java-index,Desktop,Runtime Environment...
# 3
Try System.getenv("WS_HOME");.
java_2006a at 2007-7-12 18:10:37 > top of Java-index,Desktop,Runtime Environment...