How do I access environment variables?
Basically, you can't. Plus, not all platforms have environments to get variables from. Instead of using the environment to get something, consider using either resource files or System properties.
Don't even consider using the getenv() method of the System class. It was deprecated with the Java 1.0 release. Not only is it deprecated, but it doesn't get anything.