title: selenium java chromedriver URL not opening
body: <p>I am trying to run selenium in java using chromedriver.I am getting the following error.Any help is much appreciated. Its opening the chrome browser but given url is not opening. Line <code>WebDriver driver = new ChromeDriver(chromeOptions);</code> is giving the error.<br />
  OS Version: Mac Bigsur<br />
  Selenium : 4.1.2<br />
  Chrome:99.0.4844.74<br />
  Chromedriver:99.0.4844.5</p>
  <p>Exception is :
  [Either(left): org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: was killed.
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /Applications/Google Chrome.app/Contents/MacOS/Google Chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  Build info: version: '4.1.2', revision: '9a5a329c5a'</p>
  <pre class="lang-none prettyprint-override"><code>Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [null,
  newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --disable-extensions, --headless, --disable-gpu, --no-sandbox, --no-sandbox, --incognito, --disable-application-cache, --disable-dev-shm-usage], extensions: []}}],
  desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --disable-extensions, --headless, --disable-gpu, --no-sandbox, --no-sandbox, --incognito, --disable-application-cache, --disable-dev-shm-usage], extensions: []}}}]
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
      at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:558)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
      at org.openqa.selenium.remote.RemoteWebDriver.&lt;init&gt;(RemoteWebDriver.java:161)
      at org.openqa.selenium.chromium.ChromiumDriver.&lt;init&gt;(ChromiumDriver.java:108)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:106)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:93)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:82)
      at com.automation.Launch_Chrome.main(Launch_Chrome.java:28)
  
  
  Code:
  WebDriver driver = null;
  
          System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;/usr/local/Caskroom/chromedriver/99.0.4844.51/chromedriver&quot;);
          String URL = &quot;https://www.google.com&quot;;
          ChromeOptions chromeOptions = new ChromeOptions();
          chromeOptions.setHeadless(true);
          List&lt;String&gt; arguments = new LinkedList&lt;&gt;();
          arguments.add(&quot;--disable-extensions&quot;);
          arguments.add(&quot;--headless&quot;);
          arguments.add(&quot;--disable-gpu&quot;);
          arguments.add(&quot;--no-sandbox&quot;);
  
          arguments.add(&quot;--no-sandbox&quot;);
          arguments.add(&quot;--incognito&quot;);
          arguments.add(&quot;--disable-application-cache&quot;);
          arguments.add(&quot;--disable-dev-shm-usage&quot;);
          chromeOptions.addArguments(arguments);
          try {
              driver = new ChromeDriver(chromeOptions);
          }
          catch(Exception e) {
              e.printStackTrace();
          }
          driver.get(URL);
  
  &lt;dependency&gt;
          &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
          &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
          &lt;version&gt;3.7.1&lt;/version&gt;
      &lt;/dependency&gt;   
      &lt;!--
      &lt;dependency&gt;
          &lt;groupId&gt;io.github.bonigarcia&lt;/groupId&gt;
          &lt;artifactId&gt;webdrivermanager&lt;/artifactId&gt;
          &lt;version&gt;5.1.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
              &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
              &lt;version&gt;4.1.2&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>