title: How to set up GitLab CI with a shell runner?
body: <p>I am trying to set up a minimal working example of GitLab continuous integration. I successfully created a working Spring Boot application and pushed it to my GitLab. I created a <code>.gitlab-ci.yml</code> file with the simple:</p>
  
  <pre><code>run:
    script:
      - ./gradlew bootRun
  </code></pre>
  
  <p>command. And upon pushing my changes I got the following error:</p>
  
  <pre><code>Running with gitlab-ci-multi-runner 9.4.2 (6d06f2e)
    on Martin-asus-runner (7056052b)
  Using Shell executor...
  Running on martin-UX305UA...
  Cloning repository...
  Cloning into '/home/gitlab-runner/builds/7056052b/0/Martin/ci-test'...
  Checking out b670a57a as master...
  Skipping Git submodules setup
  $ ./gradlew bootRun
  
  ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  
  Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
  
  ERROR: Job failed: exit status 1
  </code></pre>
  
  <p>Which is strange, since I have Java installed on my computer. After closer examination I found that the GitLab CI has probably created a new user named <code>gitlab-runner</code> on my system and that all the CI scripts are executed by this user. Since this user has not installed Java, the environmental variables are not set.</p>
  
  <p>What is the intended way of solving this problem? Can I somehow let the <code>gitlab-runner</code> "inherit" my environment?</p>