title: How to solve ClassNotFoundException: com.beust.jcommander.ParameterException
body: <p>I'm new to developing in JAVA and I have the problem below when compiling a class in Eclipse.
  The error while compiling is this below:</p>
  
  <p><em>"Java Virtual Machine Launcher
  Error: A JNI error has occurred, please check your installation and try again"</em></p>
  
  <p>Followed by error:</p>
  
  <p><em>"Java Virtual Machine Launcher
  A Java Exception has occurred."</em></p>
  
  <p>In the console, the error presented is what is below:</p>
  
  <pre><code>*Exception in thread "main" java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
  at java.lang.Class.privateGetMethodRecursive(Unknown Source)
  at java.lang.Class.getMethod0(Unknown Source)
  at java.lang.Class.getMethod(Unknown Source)
  at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
  at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterException
  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)
  ... 7 more*
  </code></pre>
  
  <p>Can someone help me?
  Thankful.</p>
  
  <p>AppTest.java</p>
  
  <pre><code>package all_Exercices.Different_Browsers;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.ie.InternetExplorerDriver;
  import org.testng.annotations.Parameters;
  
  
  public class AppTest
  {
      WebDriver driver;
  
      @Parameters("browser")
      public void verifypageTitle(String browserName) 
      {
          if(browserName.equalsIgnoreCase("firefox"))
          {
              driver = new FirefoxDriver();
          }
          else if(browserName.equalsIgnoreCase("chrome"))
          {
              System.setProperty("webdriver.chrome.driver", "C:\\SeleniumGecko\\chromedriver.exe");
              driver = new ChromeDriver();
          }
          else if(browserName.equalsIgnoreCase("IE"))
          {
              System.setProperty("webdriver.ie.driver", "C:\\SeleniumGecko\\IEDriverServer.exe");
              driver = new InternetExplorerDriver();
          }
  
          driver.manage().window().maximize();
          driver.get("https://shopcart-challenge.4all.com/");
          System.out.println(driver.getTitle());
          driver.quit();
      }
  }
  </code></pre>
  
  <p>crossbrowser.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt;
  &lt;suite name="Suite" parallel="tests"&gt;
    &lt;test name="FirefoxTestCases"&gt;
    &lt;parameter name="browser" value="firefox"/&gt;
    &lt;classes&gt;
      &lt;class name="all_Exercices.Different_Browsers.AppTest"/&gt;
    &lt;/classes&gt;    
    &lt;/test&gt; &lt;!--Test --&gt;
      &lt;test name="ChromeTestCases"&gt;
    &lt;parameter name="browser" value="chrome"/&gt;
    &lt;classes&gt;
      &lt;class name="all_Exercices.Different_Browsers.AppTest"/&gt;
    &lt;/classes&gt;    
    &lt;/test&gt; &lt;!--Test --&gt;
      &lt;test name="IETestCases"&gt;
    &lt;parameter name="browser" value="ie"/&gt;
    &lt;classes&gt;
      &lt;class name="all_Exercices.Different_Browsers.AppTest"/&gt;
    &lt;/classes&gt;    
    &lt;/test&gt; &lt;!--Test --&gt;
  &lt;/suite&gt; &lt;!--Suite --&gt;
  </code></pre>
  
  <p>POM.XML</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;4all_Exercices&lt;/groupId&gt;
    &lt;artifactId&gt;Different_Browsers&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;Different_Browsers&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>