Check out example codes for "java get environment variables". It will help you in understanding the concepts better.

Code Example 1

String environmentVariable = System.getEnv("environment_variable_name"); 
//You can create environment variables on your computer manually
//and then you must put the environment variable in the parantheses as a String

Code Example 2

public class Env {
    public static void main (String[] args) {
        for (String env: args) {
            String value = System.getenv(env);
            if (value != null) {
                System.out.format("%s=%s%n",
                                  env, value);
            } else {
                System.out.format("%s is"
                    + " not assigned.%n", env);
            }
        }
    }
}

Learn ReactJs, React Native from akashmittal.com