How to set the environment variables for Java in Windows (the classpath)?
Under Linux: http://lowfatlinux.com/linux-environment-variables.html
And of course, you can retrieve them from Java using:
String variable = System.getProperty("mykey");