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

后端 未结 3 1456
时光说笑
时光说笑 2021-02-18 18:32

Getting this under Eclipse straight out of the gate.

Code:

    System.setProperty(\"webdriver.chrome.driver\" ,  \"/path/to/selenium/chromedriver\");
            


        
3条回答
  •  天涯浪人
    2021-02-18 19:03

    the main problem is you have a jar conflict.

    selenium has compile dependency on guava, you can find this at: https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver/3.141.0

    if you project has another version of guava, it may use wrong guava version.

    to exclude duplicate dependency in maven, you can add right guava version explicitly, in this case:

    
    
        com.google.guava
        guava
        25.0-jre
    
    

提交回复
热议问题