title: "Error: not found: java" when running webdriver.io test
body: <p>I'm trying to run a <a href="https://github.com/DEFRA/rod-licensing-tests/tree/master/packages/frontend-acceptance-tests" rel="nofollow noreferrer">webdriver.io test suite</a> from the VS Code debugger but it is failing with the error message:</p>
  <pre><code>ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
  Error: not found: java
  at getNotFoundError (/Users/andrew/projects/rod-licensing-tests/packages/frontend-acceptance-tests/node_modules/selenium-standalone/node_modules/which/which.js:10:17)
  </code></pre>
  <p>How do I get round this? From looking at similar issues on the web, I've tried the following with the same results:</p>
  <ol>
  <li><code>npm install</code></li>
  <li>installing Java using <code>npm install java</code></li>
  <li>installing selenium-standalone with <code>./node_modules/.bin/selenium-standalone install</code></li>
  <li>adding an environment variable to my <code>launch.json</code> config: <code>&quot;JAVA_HOME&quot;: &quot;/usr/libexec/java_home&quot;</code></li>
  <li>updating Java on my Mac to Java 8 update 271 via System Preferences</li>
  </ol>
  <p>The tests do run successfully using Docker, but I'd ideally want to run this from the IDE too so that I can quickly start and debug them. Also, my colleague can run the same tests using config in IntelliJ IDE Ultimate but I feel this should be possible in VS Code too.</p>
  <p>This is the current content of my <code>launch.json</code> file:</p>
  <pre><code>{
    &quot;version&quot;: &quot;0.2.0&quot;,
    &quot;configurations&quot;: [
      {
        &quot;name&quot;: &quot;Launch via NPM&quot;,
        &quot;type&quot;: &quot;pwa-node&quot;,
        &quot;args&quot;: [
          &quot;conf/local.conf.js&quot;,
          &quot;--logLevel trace&quot;
        ],
        &quot;cwd&quot;: &quot;${workspaceFolder}/packages/frontend-acceptance-tests&quot;,
        &quot;env&quot;: {
          &quot;JAVA_HOME&quot;: &quot;/usr/libexec/java_home&quot;,
          &quot;SERVICE_URL&quot;: &quot;[redacted]&quot;,
          &quot;OAUTH_AUTHORITY_HOST_URL&quot;: &quot;[redacted]&quot;,
          &quot;OAUTH_TENANT&quot;: &quot;[redacted]&quot;,
          &quot;OAUTH_CLIENT_ID&quot;: &quot;[redacted]&quot;,
          &quot;OAUTH_CLIENT_SECRET&quot;: &quot;[redacted]&quot;,
          &quot;OAUTH_SCOPE&quot;: &quot;[redacted]&quot;,
          &quot;DYNAMICS_API_PATH&quot;: &quot;[redacted]&quot;,
          &quot;DYNAMICS_API_VERSION&quot;: &quot;9.1&quot;
        },
        &quot;request&quot;: &quot;launch&quot;,
        &quot;runtimeExecutable&quot;: &quot;${workspaceFolder}/packages/frontend-acceptance-tests/node_modules/.bin/wdio&quot;,
        &quot;runtimeVersion&quot;: &quot;14.13.0&quot;
      }
    ]
  }
  </code></pre>
  <p>I'm pretty new to Node.JS so still learning how it fits together. Any suggestions appreciated!</p>