title: Set Environment Variable with Spring Boot Gradle plugin and IntelliJ
body: <p>My question is about environment variables.
  I am using the Spring Boot Gradle plugin and developing in Intellij 14 on Windows.</p>
  
  <p>I'm trying to get some Pub/Sub example code for Google API's working, but I don't think this is the main point of my question (Noted here since I could be wrong!)
  If not running on AppEngine, the sample code has a number of ways that you can satisfy it by supplying a file with authentication credentials.  I currently have no plans to use AppEngine.</p>
  
  <p>I am asked to set an <strong>environment variable</strong> named GOOGLE_APPLICATION_CREDENTIALS and after some small amount of hair-pulling I've learned that a system property will not suffice.  It must be an environment variable.</p>
  
  <p>I would like to do this in a way that adjusts the environment for only this IntelliJ project and not for everything on the machine.  Normally in IntelliJ I would do this by adding the environment variable to the launch configuration options.
  Since I am using the Spring Boot Gradle plugin, I have a <strong>'bootRun'</strong> launch configuration for my project.
  The launch configuration options screen has the following major options:  Name, Gradle Project, Tasks, VM Options, Script Parameters, Before Launch</p>
  
  <p>There is NO option for Environment Variables.</p>
  
  <p>I am aware that I could probably fix this problem by doing one of the following:</p>
  
  <ul>
  <li>Add the environment variable under the windows system control panel</li>
  <li>Stop using the Spring Boot plugin so that the 'Environment Variables'
  section of the launch configuration options comes back as an option</li>
  </ul>
  
  <p>What I am hoping is that there is another option I'm not aware of due to my lack of knowledge about Spring [Boot] and/or Gradle.  </p>