My OS is windows7. I want to read the environment variables in my Java application. I have searched google and many people\'s answer is to use the method System.getP
In case anyone is coming here and wondering how to get a specific environment variable without looping through all of your system variables you can use getenv(String name). It returns "the string value of the variable, or null if the variable is not defined in the system environment".
String myEnv = System.getenv("env_name");