IllegalAccessError thrown by new ChromeDriver() on OSX (Java)

Igor Urisman picture Igor Urisman · Aug 11, 2017 · Viewed 12.2k times · Source

Getting this under Eclipse straight out of the gate.

Code:

    System.setProperty("webdriver.chrome.driver" ,  "/path/to/selenium/chromedriver");
    WebDriver driver = new ChromeDriver();

Throws Exception:

Exception in thread "main" java.lang.IllegalAccessError: tried to access method com.google.common.util.concurrent.SimpleTimeLimiter.<init>(Ljava/util/concurrent/ExecutorService;)V from class org.openqa.selenium.net.UrlChecker
    at org.openqa.selenium.net.UrlChecker.<init>(UrlChecker.java:67)
    at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:190)
    at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:181)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)

OSX 10.12 Selenium 3.4 ChromeDriver 2.31

Answer

Walter picture Walter · Aug 14, 2017

Setting this back to 22.0 helped for me.

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>22.0</version>
    </dependency>