0

Im using Mac laptop, I got this from youtube for mac tutorial, but its working for other students

Forgive me I am new to selenium

Not sure if Im missing somethingPicture of the exception

import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;

public class Main { public static void main(String [] args) {

    System.setProperty("webdriver.chrome.driver","/Users/c054148/Downloads/chromedriver");
    WebDriver obj = new ChromeDriver();
    obj.get("https://www.google.com");
}

} Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap at org.openqa.selenium.remote.service.DriverService$Builder.(DriverService.java:259) at org.openqa.selenium.chrome.ChromeDriverService$Builder.(ChromeDriverService.java:101) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:94) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at Main.main(Main.java:8) Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 5 more

Jesse G
  • 31
  • 4
  • Does this answer your question? [Why am I getting a NoClassDefFoundError in Java?](https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) – maio290 Mar 10 '20 at 09:54
  • It seems like you have not added some dependency jars. See if there are any additional files to be included into the project. – Deepak Kumar Mar 10 '20 at 09:59

1 Answers1

1

Seems you have missed the extension of the ChromeDriver. It should be chromedriver.exe

 System.setProperty("webdriver.chrome.driver","/Users/c054148/Downloads/chromedriver.exe");
Ahamed Safnaj
  • 611
  • 1
  • 6
  • 18