How to get Environment Variables?
Environment variables are sets of dynamic values that can affect a running process, such as our Java program. Each process usually have there own copy of these variables.
Now we'd like to obtain the available variables in our environment or operating system, how do I do this in Java? Here is a code example of it.
Here are some result on my machine.
ANT_HOME = D:Developmentapache-ant-1.6.5
CATALINA_HOME = D:Developmentapache-tomcat-5.5.15
ANT_OPS = -Djava.util.logging.config.file=logging.properties
CLASSPATH = .;C:Program FilesJavajre1.5.0_09libextQTJava.zip
OC4J_HOME = D:Developmentoc4j-extended-101310
JAVA_HOME = D:DevelopmentJavajdk1.5.0_09
GERONIMO_HOME = D:Developmentgeronimo-1.0