原因一:

没有设置chrome driver的位置

//设置driver位置的方法。

System.setProperty(“webdriver.chrome.driver”, “/Users/supinrong/code/driver/chromedriver”);

原因二:

guava版本冲突

The problem is that both dependencies depend on a different com.google.guava:guava artifact.

In order to solve the error, you should explicitly depend on a single com.google.guava:guava artifact. So go ahead and add the following in your build.gradle:

compile 'com.google.guava:guava:27.0.1-jre'

将以下依赖项复制并粘贴到pom.xml中,然后进行Maven构建:

<!--   https://stackoverflow.com/questions/49021707/java-lang-nosuchmethoderror-com-google-common-base-preconditions-checkstatezlj?rq=1  -->
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>27.1-jre</version>
</dependency>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2021-10-16
  • 2022-03-06
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-26
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案