1

So while creating a new selenium java project and using the latest selenium version (3.141.59) form the website, i encountered the following exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
at org.openqa.selenium.remote.service.DriverService$Builder.<init>(DriverService.java:259)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.<init>(ChromeDriverService.java:101)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
at test.src.main(src.java:11)

Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
2
  • 1
    There is a library missing in your classpath. Commented May 28, 2020 at 21:53
  • You might be missing the google-collections dependency in your classpath Commented May 28, 2020 at 21:54

1 Answer 1

3

It turn out that in the latest selenium (3.141.59) download available form the selenium website I couldn't find a standalone anymore. Instead my problem was resolved by manually adding the client-combined-3.141.59.jar and all the jar files present in the lib folder to the Build Path of the project.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.