title: Error: Unable to initialize main class base Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/Capabilities
body: <p>I have looked through all the solutions, but all of them are vague. They just tell to add jar files, but don't specify which ones and from where. The links provided are also very vague. Besides this, another solution was to add jar files to classpath, not module path, but I am unable to find where either of them are located in the configure path option. Following is my code:</p>
  <pre><code>import java.io.File;
  import java.net.MalformedURLException;
  import java.net.URL;
  
  import org.openqa.selenium.remote.DesiredCapabilities;
  
  import io.appium.java_client.android.AndroidDriver;
  import io.appium.java_client.android.AndroidElement;
  import io.appium.java_client.remote.MobileCapabilityType;
  
  
  public class base {
  
      public static void main(String[] args) throws MalformedURLException { 
          // TODO Auto-generated method stub
          File f=new File(&quot;src&quot;);
          File fs=new File(f, &quot;app-debug.apk&quot;);
      
          DesiredCapabilities cap=new DesiredCapabilities();
          cap.setCapability(MobileCapabilityType.DEVICE_NAME, &quot;Nexus_5X_API_30_2&quot;);
          cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, &quot;uiautomator2&quot;);
          cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath());
          AndroidDriver&lt;AndroidElement&gt; driver=new AndroidDriver&lt;&gt;(new 
          URL(&quot;http://127.0.0.1:4723/wd/hub&quot;),cap);
  
      }
  
  }
  </code></pre>