title: How to run a java program with selenium jar through command line
body: <p>How to run a java program with selenium jar through command line...  </p>
  
  <pre><code>import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  public class HelloSelenium {
  
      public static void main(String[] args) {
          WebDriver driver;
  
          driver = new FirefoxDriver();
          System.out.println("Hello");
      }
  
  }
  </code></pre>
  
  <p>I am getting following error on running it through CLI</p>
  
  <blockquote>
    <p>java -cp ".;./jars/selenium-java-2.53.0.jar" HelloSelenium</p>
  </blockquote>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
      at HelloSelenium.main(HelloSelenium.java:11)
  Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
      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)
      ... 1 more
  </code></pre>