You need to learn what environment variables are, and what they are used for. In general, you don't need to set environment variables in order for most commands to execute properly. There are, however, exceptions, and in those cases you might need to use the setProcessEnvironment() call to provide them.

If you can execute your command at the console prompt, you probably don't need to worry about setting environment variables for it. Not understanding them, however, is likely to cause problems later.