Specifying any Environment Variables in a Project's Configuration

Specifying required environment variables within a Jenkins project's configuration makes the project more portable between different operating systems and reduces the chances of any external factors causing the build to fail.

Using this approach might mean that there could be some duplication in projects so choose the best method depending on how your particular project runs.