title: Selenium Webdriver + Java - Eclipse: java.lang.NoClassDefFoundError
body: <p>I installed JDK from here: <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" rel="nofollow noreferrer">http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a>
  (This version for windows x64: Java SE Development Kit 8u151)</p>
  
  <p>I downloaded eclipse from here:
  <a href="http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/oxygenr" rel="nofollow noreferrer">http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/oxygenr</a>
  (Windows 64-bit)</p>
  
  <p>I opened a new project in eclipse: File->New->Java Project</p>
  
  <p>Then I downloaded Selenium Java Jars from here:
  <a href="http://www.seleniumhq.org/download/" rel="nofollow noreferrer">http://www.seleniumhq.org/download/</a> ---> java language</p>
  
  <p>Then in eclipse I click on my project -> properties ->Java Build Path -> Libraries tab -> Add External JARs... -> I go to "SeleniumDrivers\Java" library (there I saved all the JARS that I downloaded) -> I checked all the files there:
  <a href="https://i.stack.imgur.com/8dT6j.png" rel="nofollow noreferrer">these files</a></p>
  
  <p>I clicked on "ok" and created a new class in eclipse</p>
  
  <p>Then I downloaded chromedriver from here: <a href="http://www.seleniumhq.org/download" rel="nofollow noreferrer">http://www.seleniumhq.org/download</a></p>
  
  <p>I unzipped it and saved it here: C:\Selenium\Drivers</p>
  
  <p>This is my script:</p>
  
  <pre><code>import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  
  public class MainClass {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          System.out.println("hi there\n");
  
          System.setProperty("webdriver.chrome.driver", 
          "C:/Selenium/Drivers/chromedriver.exe");
          WebDriver driver = new ChromeDriver();
          driver.get("https://www.facebook.com");
      }
  
  }
  </code></pre>
  
  <p>As you can see, this is a very basic script which opens chrome browser and navigate to facebook.</p>
  
  <p>I run this script and got this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/config/RegistryBuilder
      at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:69)
      at org.openqa.selenium.remote.internal.HttpClientFactory.&lt;init&gt;(HttpClientFactory.java:57)
      at org.openqa.selenium.remote.internal.HttpClientFactory.&lt;init&gt;(HttpClientFactory.java:60)
      at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:242)
      at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.&lt;init&gt;(ApacheHttpClient.java:219)
      at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:93)
      at org.openqa.selenium.remote.HttpCommandExecutor.&lt;init&gt;(HttpCommandExecutor.java:72)
      at org.openqa.selenium.remote.service.DriverCommandExecutor.&lt;init&gt;(DriverCommandExecutor.java:63)
      at org.openqa.selenium.chrome.ChromeDriverCommandExecutor.&lt;init&gt;(ChromeDriverCommandExecutor.java:36)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:181)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:168)
      at org.openqa.selenium.chrome.ChromeDriver.&lt;init&gt;(ChromeDriver.java:123)
      at MainClass.main(MainClass.java:11)
  Caused by: java.lang.ClassNotFoundException: org.apache.http.config.RegistryBuilder
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 13 more
  </code></pre>
  
  <p>I don't know how to resolve this issue, can you please help to solve it so that I will be able to run my basic script?</p>